How can I convert this structure

```
<div class="parent"> 
   <div class="someclass">
       <b>some HTML</b>
       ...
   </div>
   <div class="someclass">
       <b>some HTML</b>
       ...
   </div>
</div>

```

into

```
<div class="parent">
   <span class="someclass">
       <b>some HTML</b>
       ...
   </span>
   <span class="someclass">
       <b>some HTML</b>
       ...
   </span>
</div>

```

I have valid HTML markup, but since there are many other div's I can't do a preg\_replace.

I like a server side solution (PHP)