Replase character string to html

Replase character string to html

Hi.
I have
  1. <ul id="some_id">
  2. <li><a href="#"><span>some text || some text1</span></a></li>
  3. </ul>
I need to replace it with
  1. <ul id="some_id">
  2. <li><a href="#"><span class="some_class">some text</span><span class="some_class1">some_text1</span></a></li>
  3. </ul>

or just
  1. <ul id="some_id">
  2. <li><a href="#"><span>some text<span class="some_class1">some_text1</span></span></a></li>
  3. </ul>
in case what text is dinamic