I doubt there is a way to get the element which has a particular value (text) from xml document using xpath.
Example doc:
<domain log-root="/logs" application-root="/applications"><resources>
<jdbc-resource pool-name="SamplePool" jndi-name="jdbc/sample" />
<jdbc-resource pool-name="TimerPool" jndi-name="abc">text1</jdbc-resource>
<jdbc-resource pool-name="TimerPool" jndi-name="def">text2</jdbc-resource>
<jdbc-resource pool-name="TimerPool" jndi-name="ghi">text3</jdbc-resource></resources</domain>
Example xPath Query:
/domain//jdbc-resource[@pool-name='TimerPool']/text()='text2'
Please post your ideas if there is any.