 <p>It may help to look at it from a different perspective. Your semi-complete solution is focusing on parents elements of your desired data, but you could also use the child or relative path identifiers. </p> <p>I got this XPATH: </p> <pre><code>a/c/following-sibling::node() </code></pre> <p>To return:</p> <pre><code> MARKER other text 1 &lt;b&gt;MARKER other text 2&lt;/b&gt; M &lt;b&gt;ARKE&lt;/b&gt; R &lt;e&gt;other&lt;/e&gt; text 3 </code></pre> <p>And while that isn't in exactly the format you're looking for, it's the correct data, XPATH wasn't really made for formatting your results so there's not much to work with there. </p>