Try this:
//foo/following-sibling::text()[1]
(replace //foo/
with your current XPath expression.
With this XML:
<data>
<foo>foo</foo>
bar
<baz>baz</baz>
</data>
it gives bar
as output.
Try this:
//foo/following-sibling::text()[1]
(replace //foo/
with your current XPath expression.
With this XML:
<data>
<foo>foo</foo>
bar
<baz>baz</baz>
</data>
it gives bar
as output.