def METHOD_NAME(self, node=None):
    if node is None:
        node = self
    if hasattr(node, 'nodes'):
        for child in node.nodes:
            yield child
            for sub_child in self.METHOD_NAME(child):
                yield sub_child