a tree structure with Bro records

You could fake it up using table[string] of XYZ, where XYZ records include
a string that point back into the table. Not pretty, but seems it should
work.

(or, slightly easier, a table[count] of XYZ, along with a counter that you
just increment every time you add a new node, which becomes its identifier)