replacing div tag
<p>I have the following code,</p>

<pre><code>&lt;div id=1 class="mydiv"&gt;  &lt;span&gt;some data&lt;/span&gt;&lt;/div&gt;
&lt;div id="q-1"&gt;data&lt;/div&gt;
&lt;div id=2 class="mydiv"&gt;  &lt;span&gt;some data&lt;/span&gt;&lt;/div&gt;
&lt;div id="q-2"&gt;data&lt;/div&gt;
&lt;div id=3 class="mydiv"&gt;  &lt;span&gt;some data&lt;/span&gt;&lt;/div&gt;
&lt;div id="q-3"&gt;data&lt;/div&gt;
&lt;div id=4 class="mydiv"&gt;  &lt;span&gt;some data&lt;/span&gt;&lt;/div&gt;
&lt;div id="q-4"&gt;data&lt;/div&gt;
&lt;div id=5 class="mydiv"&gt;  &lt;span&gt;some data&lt;/span&gt;&lt;/div&gt;
&lt;div id="q-5"&gt;data&lt;/div&gt;
</code></pre>

<p>I need to exchange a div of a given ID with the one after it, <strong>with the same class</strong>.</p>
