public final Node replaceChild(Node newChild, Node _oldChild) throws DOMException {
if (!(_oldChild instanceof CoreChildNode)) {
throw newDOMException(DOMException.NOT_FOUND_ERR);
}
CoreChildNode oldChild = (CoreChildNode)_oldChild;
if (oldChild.coreGetParent() != this) {
throw newDOMException(DOMException.NOT_FOUND_ERR);
}
checkNewChild(newChild, _oldChild);
CoreChildNode nextSibling = oldChild.coreGetNextSibling();
oldChild.coreDetach(coreGetOwnerDocument(true));