How to get complete child nodes of an xml
Hi,
I am trying to parse an xml something like this given below.
<root>
<child1>
<sub1-child1>text</sub1-child1>
<sub1-child2>text</sub1-child2>
<sub1-child3>text</sub1-child3>
</child1>
<child2>
<sub2-child1>text</sub2-child1>
<sub2-child2>text</sub2-child2>
<sub2-child3>text</sub2-child3>
</child2>
<child3>
<sub3-child1>text</sub3-child1>
<sub3-child2>text</sub3-child2>
<sub3-child3>text</sub3-child3>
</child3>
</root>
If I am asking for the parser to get <child1> then I expect the output should be like this given below:
<child1>
<sub1-child1>text</sub1-child1>
<sub1-child2>text</sub1-child2>
<sub1-child3>text</sub1-child3>
</child1>
I dont want to get a nodelist for looping for all the sub child elements. But i saw DOM parser which is used only for getting one by one child element. I am not getting all the sub child elements along with the child element if i query for a child element.
I hope you got my point and let me know your thoughts on this. Thanks for your help in Advance.