I have an xml as follow:
<root>
<outer>
<name>abc</name>
<age>20</age>
</outer>
<outer>
<name>def</name>
<age>30</age>
</outer>
<outer>
<name>ghi</name>
<age>40</age>
</outer>
</root>
I want to fetch the value of age tag for a given value of name tag?
One way is that I can prepare a map of name to age by parsing this xml using Document interface.
But is there any api that I can just call for Document interface in which I can say fetch element where name is say,ghi, and then i can iterate all atributes to get age attribute or any other simple way to get age where name value is,say ghi?