adoptNode

fun <T : Node> adoptNode(node: T): T(source)

Moves node from another document and returns it.

If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException.

MDN Reference