in reply to LibXML: Change a node into a comment

use the replace... method to replace one node with a new node  [dom replace] [libxml replace] [xml replace] dom replace libxml replace xml replace -> Replace the Text of an XML Element Using LibXML and DOM, How do I get LibXML to replace attribute values?, replace node in xml, replaceChild in LibXML

xml.com DOM Tutorials