Non-trivial selections using jQuery based on content of previous element
<p>Consider the following markup:</p>

<pre><code>&lt;x&gt;
   &lt;y&gt;code1&lt;/y&gt;
   &lt;z&gt;stuff&lt;/z&gt;
   &lt;y&gt;code2&lt;/y&gt;
   &lt;z&gt;foobar&lt;/z&gt;
&lt;/x&gt;
</code></pre>

<p>Using jQuery, how do I select the <code>&lt;z&gt;foobar&lt;/z&gt;</code> node in the given markup using the following rule: find the <code>z</code>-node that follows after a <code>y</code>-node which has a body containing <code>"code2"</code>?</p>
