Creating links for elements with a particular class with jQuery
<p>How can I wrap every element belonging to a particular class with a link that is built from the text inside the div? What I mean is that I would like to turn:</p>

<pre><code>&lt;foo class="my-class&gt;sometext&lt;/foo&gt;
</code></pre>

<p>into</p>

<pre><code>&lt;a href="path/sometext" &gt;&lt;foo class="my-class&gt;sometext&lt;/foo&gt;&lt;/a&gt;
</code></pre>

<p>Url encoding characters would also be nice, but can be ignored for now if necessary.</p>

<p><strong>EDIT</strong>: Just to clarify, the path depends on the text within the element</p>
