// Get XML nodes for the DOM nodes passed in
final DomNode newChildNode = newChild.getDomNodeOrDie();
final DomNode oldChildNode;
// Replace the old child with the new child.
oldChildNode = ((Node) oldChildObject).getDomNodeOrDie();
oldChildNode.replace(newChildNode);
removedChild = oldChildObject;
}
return removedChild;
}