Can I get records with selectData as tree

I wonder if there’s some undocumented feature or someone has a tip/trick how to get records as a tree. I know it’s possible in the datamanager, but here I need it in the front end.

Ist there something in Preside or do I need to dig into recursive functions by myself?

Thanks for any idea.

I found how BenNadel did it (Replacing Depth-First Recursion With A Breadth-First While-Loop In Lucee CFML 5.3.3.62), but if there’s already something in Preside I’d prefer that.

There a no special tree helpers in Preside.