<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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