Can you give me any hints on how I could modify this to read in the various levels from an existing <ul> on the page? Or form a set of nested <div>'s or from provided XML?
The reason I ask is that I think it is much easier to navigate this way from other tree based data, and if JS was disabled for a given page, you could still show the entire <ul> as plaintext.