returns ALL elements of the complete hirarchy as a flat list

def getAllElementsOfHirarchy(self):
        """ returns ALL elements of the complete hirarchy as a flat list
        """
        allElements=[]
        for element in self.getAllElements():
            allElements.append(element)
            if isinstance(element, BaseElement):
                allElements.extend(element.getAllElementsOfHirarchy())
        return allElements