Nested Tree Behaviour

I quite like the Tree Behaviour.
But unfortunately the 'separator' idea is a little too primitive for flexible HTML.
The problem lies in the fact that generatetreelist always returns a flat structure.

Here's a way to return a structure grouped by parent_id, which would allow you to intelligently traverse the tree.