def importNode(self, document, node, deep=<NUM_LIT:0>):
nodetype = node.nodeType<EOL>if nodetype in (node.DOCUMENT_NODE, node.DOCUMENT_TYPE_NODE):<EOL><INDENT>raise DOMException('<STR_LIT>')<EOL><DEDENT>if nodetype == node.ENTITY_REFERENCE_NODE:<EOL><INDENT>deep = <NUM_LIT:0><EOL><DEDENT>clone = node.cloneNode(deep)<EOL>self._setOwnerDoc(document, clone)<EOL>clone.__imported__ = <NUM_LIT:1><EOL>return clone<EOL>
Implements (well enough for our purposes) DOM node import.