private function addNode(\DOMNode $target, \DOMNode $source)
{
if ($source instanceof \DOMElement) {
$this->addElement($target, $source);
} else {
$document = $target instanceof \DOMDocument ? $target : $target->ownerDocument;
$target->appendChild($document->importNode($source));
}
}