breadth first iterator for tree fragment