for a tree of nodes, I'd like to select not only a node but also its
outbound connections and their endpoint nodes, and so on. Obviously
need to detect cycles. I have found no example of this. Any ideas?