tree_walk function

Generate a TreeCursor iterator