protected function transferTo(\DOMNode $node, $json)
{
if (is_object($json)) {
/** @var Document $dom */
$dom = $node->ownerDocument ?: $node;
$nodeName = $json->{'#name'};
list($attributes, $namespaces) = $this->getAttributes($json);
$child = $dom->createElementNS($this->getNamespaceForNode($nodeName, $namespaces, $node), $nodeName);
$node->appendChild($child);
$this->transferText($dom, $child, $json);
$this->transferChildren($child, $json, $namespaces, $attributes);
}
}