AbstractNode replace_node(AbstractNode new)
Replaces this node with the provided one.
Returns the new node.