XPath selection by innertext
Matt said it, but the full solution:
//myparent[mychild='foo']/mychild
Have you tried this?
//myparent/mychild[text() = 'foo']
Alternatively, you can use the shortcut for the self
axis:
//myparent/mychild[. = 'foo']