With the xpath /levels/level[@id="3"]/value I can get the value of level where id=3 like this:
<levels> <level id="2"> <value>25</value> </level> <level id="3"> <value>33</value> </level> <level id="4"> <value>44</value> </level> </levels> but the XML I am reading is formatted without attributes like this:
<levels> <level> <id>2</id> <value>25</value> </level> <level> <id>3</id> <value>33</value> </level> <level> <id>4</id> <value>44</value> </level> </levels> What is the equivalent xpath for this second XML block which will get the value of level where id=3? (It is not guaranteed that id=3 will always be the second node.)