replaceWith

fun Node.replaceWith(other: Node)

Replace this node with other (by modifying the children of the parent node.) For this to work, Node.assignParents must have been called.

Note that we recognize the exact same Node, looking at its identity, not using equality.