Inserting Nodes into an XML Document
You can modify the document by inserting new nodes. The nodes can be newly created, existing in the same document, or they can be imported from another document. For more information about creating new nodes, see Create New Nodes in the DOM. For more information on copying existing nodes, see Copy Existing Nodes, Copying Existing Nodes from One Document to Another, or Copying Document Fragments.