XPath selection by innertext
Have you tried this?
//myparent/mychild[text() = 'foo']
Alternatively, you can use the shortcut for the self
axis:
//myparent/mychild[. = 'foo']
Matt said it, but the full solution:
//myparent[mychild='foo']/mychild
You might consider using the contains
function to return true/false if the test was found like so:
//mychild[contains(text(),'foo')]
See XSLT, XPath, and XQuery Functions for functions reference