'Removes the child node indicated by oldChild from the list of children, and returns it.'

def removeChild(self, oldChild):

    try:
        self.childNodes.remove(oldChild)
    except ValueError:
        raise xml.dom.NotFoundErr()
    if (oldChild.nextSibling is not None):
        oldChild.nextSibling.previousSibling = oldChild.previousSibling
    if (oldChild.previousSibling is not None):
        oldChild.previousSibling.nextSibling = oldChild.nextSibling
    oldChild.nextSibling = oldChild.previousSibling = None
    if self.ownerDocument:
        self.ownerDocument.clear_caches()
    oldChild.parentNode = None
    return oldChild
