@staticmethod
def remove_node(node):
    """Removes the node from the current document it is in.
        Returns the previous sibling is possible, otherwise it
        returns the parent node.
        """
    parent = node.parent
    index = node.index
    del parent[index]
    if -1 < index < len(parent):
        return parent[index]
    return parent
