TypeError thrown

Argument 1 passed to DOMDocument::importNode() must be an instance of DOMNode, null given