• You may not think this is a tree structure but for each individual starter node, for all pratical puposes, it is and it would probably help you to think of it a a tree structure with some looping branches that need to be stopped.

    There was an article here a month or 3 back about recursive selects and I think that would be a good way to go if they work (I've never used them).