$node->appendChild($doc->createTextNode($obj));
} else if (is_associative_array($obj)) { # substitute
$num_children = ($node->childNodes == null) ? 0 : $node->childNodes->length;
$node->appendChild($doc->createTextNode($obj));
} else if (is_associative_array($obj)) { # substitute
$num_children = ($node->childNodes == null) ? 0 : $node->childNodes->length;