def walk_tree(start, attr):
path = [start]<EOL>for child in path:<EOL><INDENT>yield child<EOL>idx = path.index(child)<EOL>for grandchild in reversed(getattr(child, attr)):<EOL><INDENT>path.insert(idx + <NUM_LIT:1>, grandchild)<EOL><DEDENT><DEDENT>
Recursively walk through a tree relationship. This iterates a tree in a top-down approach,
fully reaching the end of a lineage before moving onto the next sibling of that generation.