richer iteration over nodes, with tests, docs and example