Replaces a child node specified in the <OldNode> parameter by a node specified in the <NewNode> parameter. If the new node is DocumentFragment, the replaced node will be replaced by all child nodes of the document fragment. If the new node is already included in the document tree, it is first deleted from the child nodes of the previous parent and then is inserted into the child node list of the new parent.