importNode always returns createXMLReferenceOrThrow(XMLNode, ...), so many methods will return wrong type with elements from another document.
let elem = doc1.root().addChild(doc2.createElement("elem"))
// elem.getAttribute and so on does not exist!
console.log(elem.getAttribute == undefined)
A solution could be to use refToNodeType() instead to return correct type.
See also #653