find and replace img with a content and its parent attribute change

find and replace img with a content and its parent attribute change

I want to change from

  1. <span id="DeltaPlaceHolderPageTitleInTitleArea">
    <span>
    <span>
    <span style="height:16px;width:16px;position:relative;display:inline-block;overflow:hidden;"><img />
    </span>
    </span>
    </span>

to the below using JQuery

  1. <span id="DeltaPlaceHolderPageTitleInTitleArea">
  2. <span>
  3. <span>
  4. <span style="height:16px;width:26px;position:relative;display:inline-block;overflow:hidden;">
  5. <i class="fa fa-angle-right GetSomeSpace" style="font-size:20px;" aria-hidden="true"></i>
  6. </span>
  7. </span>
  8. </span>