Consider:
<Envelope>
<whichNode>node2</whichNode>
<node1>Hello</node1>
<node2>World</node2>
</Envelope>
Can I use a single XPath expression to get the value of the node specified in “whichNode”, in this case, return the value “World”? I’ve seen any number of things looking for matching attributes, but in this case, I don’t even know beforehand the NAME of the node, much less any value or attributes.
Use: