We have tree structure like this:
<Tree>
<child1>
<child2>
<child2>
</child1>
</Tree>
Here the child2 can be at any level. Is there any way we can access child2 without knowing the hierarchy?
Thanks for all answer..is there any way in Castor?as we are using Castor for marshalling and unmarshilling
Here is a similar type of question: How to get a node from xml not knowing its level in flex?
Using XPath, you could do it something like this:
Where doc is your org.w3c.dom.Document class.