in reply to Replacing an XPath node with the value of its content
$parentnode = $node -> parentNode; $txtnode = XML::LibXML::Text ->new($tmtext); $node = $parentnode -> replaceChild($txtnode, $node); [download]