'Get a list of ancestors.
@return: A list of ancestors.
@rtype: [L{Element},..]'

def ancestors(self):

    ancestors = []
    p = self.parent
    while (p is not None):
        ancestors.append(p)
        p = p.parent
    return ancestors
