in reply to Re: Replacing an XPath node with the value of its content
in thread Replacing an XPath node with the value of its content

Your step #1 was the ticket! Thanks AM. I was not first constructing a new text node.

The simple fix:
$parentnode = $node -> parentNode; $txtnode = XML::LibXML::Text ->new($tmtext); $node = $parentnode -> replaceChild($txtnode, $node);
SC