Which is more efficient: nested predicate or selecting parent element (generally traversing ancestors)
<p>Having an XML like this:</p>

<pre><code>&lt;foo&gt;&lt;bar&gt;   foobar   &lt;/bar&gt;&lt;/foo&gt;
</code></pre>

<p>which one of the following XPath expression is faster/efficient for selecting the 'foo' element, containing a certain 'bar' element:</p>

<pre><code>//bar[contains(text(), 'foobar')]/..
</code></pre>

<p>or</p>

<pre><code>//foo[bar[contains(text(), 'foobar')]]
</code></pre>

<p>?</p>