myDocument.importNode( importedNode, deep ) in DOM Level 2 Core

Imports a node from another document to this document.


importedNode Node The node to import.
deep Boolean If true, recursiv
Return Type


The returned node has no parent; (parentNode is null). The source node is not altered or removed from the original document; this method creates a new copy of the source node.

For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's nodeName and nodeType, plus the attributes related to namespaces (prefix, localName, and namespaceURI).

Additional information is copied as appropriate to the nodeType (see link), attempting to mirror the behavior expected if a fragment of XML or HTML source was copied from one document to another, recognizing that the two documents may have different DTDs in the XML case. See the official specifications for information specific to each type of node.