Basically I am trying to turn something like this: <div>Hello <i>Joe</i>, nice to meet you</div> into this: <p>Hello <i>Joe</i>, nice to meet you</p> by making a new node, inserting before the old node and then removing the old node. The problem is that I am populating the value of the new node with the $oldNode->nodeValue property which apparently only includes text, not child nodes, so I end up with: <p>Hello Joe, nice to meet you</p> How do you get the entire node value including any subnodes that may appear within? This is basically a variation on my previous post about how to DomDocument->renameNode().