If you have DOMNode in PHP, how can you get the outer xml (i.e. the all of the XML that is inside this element plus the element itself)?
For example, lets say this is the structure
<car>
<tire>Michelin</tire>
<seats>Leather</seats>
<type>
<color>red</color>
<make>Audi</make>
</type>
</car>
And I have a pointer to the <type> node… I want to get back
<type>
<color>red</color>
<make>Audi</make>
</type>
If I just ask for the text, I get back "redAudi".
You need a DOMDocument:
Check DOMDocument::saveXML in the docs for more info.
When you pass a DOMNode to saveXML() you get back only the contents of that node not the whole document.