'Adds the node newChild to the end of the list of children of this node.
If the newChild is already in the tree, it is first removed.'

def appendChild(self, newChild):

    if (newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE):
        for c in tuple(newChild.childNodes):
            self.appendChild(c)
        return newChild
    if (newChild.nodeType not in self._child_node_types):
        raise IllegalChild, ('<%s>    is    not    allowed    in    %s' % (newChild.tagName, self.tagName))
    if (newChild.parentNode is not None):
        newChild.parentNode.removeChild(newChild)
    _append_child(self, newChild)
    newChild.nextSibling = None
    return newChild
