Appends newChild as the last child of this node.
Set objXMLDOMNode = oXMLDOMNode.appendChild(newChild)
HRESULT appendChild( IXMLDOMNode *newChild, IXMLDOMNode **outNewChild);
In the case in which newChild has an existing parent, the node is automatically removed from that parent before being inserted into its new location.
When moving a node, it retains its namespace information. Moving a node doesn't create a namespace declaration, but declarations are added when retrieving the XML source (via the IXMLDOMDocument::save or IXMLDOMNode::get_xml method) to ensure that all namespaces are properly declared.
When inserting a node tree under another node that has a different owner document, the ownerDocument method for each inserted node is changed to match the owner document of its new parent.
When moving a node tree to another document, the content of all entity reference nodes contained therein is updated to conform with the new document. So if the new document does not declare an entity that was moved into it, the entity reference will have no children, and the old content is removed. Existing references to nodes under the entity reference are still valid, but the node whose parent perviously was the entity reference now has a null parent.
Note that this is equivalent to calling insertBefore(newChild, null). For complete information, see the insertBefore method.