public void __adoptNode(__XElement e) { // adoptNode not available in java 1.4 // should use importNode? // org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used // in a different document than the one that created it. if (e.InternalValue.getOwnerDocument() != this.InternalValue.getOwnerDocument()) { var ownerDocument = this.InternalValue.getOwnerDocument(); try { // IE does not implement adoptNode yet //e.InternalValue = ownerDocument.importNode(e.InternalValue, true); e.InternalValue = ownerDocument.adoptNode(e.InternalValue); e.InternalNotifyChildren(); } catch { throw; } } }