src/Nodes/NodeTrait.php
public function createNode($originalNode, $tagName)
    {
        $text = $originalNode->getTextContent();
        $newNode = $originalNode->ownerDocument->createElement($tagName, $text);

        return $newNode;
    }
public function createNode($originalNode, $tagName)
    {
        $text = $originalNode->getTextContent();
        $newNode = $originalNode->ownerDocument->createElement($tagName, $text);

        return $newNode;
    }
public function createNode ( $ originalNode , $ tagName ) { $ text = $ originalNode -> getTextContent ( ) ; $ newNode = $ originalNode -> ownerDocument -> createElement ( $ tagName , $ text ) ; return $ newNode ; }
Creates a new node based on the text content of the original node.

@param $originalNode DOMNode
@param $tagName string

@return DOMElement
Creates a new node based on the text content of the original node .