registerNodeClass('DOMElement', 'JSLikeHTMLElement'); $doc->loadHTML('

Para 1

Para 2

'); $elem = $doc->getElementsByTagName('div')->item(0); // print innerHTML echo $elem->innerHTML; // prints '

Para 1

Para 2

' echo "\n\n"; // set innerHTML $elem->innerHTML = 'FiveFilters.org'; echo $elem->innerHTML; // prints 'FiveFilters.org' echo "\n\n"; // print document (with our changes) echo $doc->saveXML(); ?>