Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If the newChild is already in the tree, it is first removed.
Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors.