public function transferTo(\DOMNode $node, $json)
{
if (is_array($json) && count($json) > 0) {
$this->transferToElement($node, $json);
} elseif (is_scalar($json)) {
$dom = $node instanceof \DOMDocument ? $node : $node->ownerDocument;
$node->appendChild($dom->createTextNode($this->getValueAsString($json)));
}
}