Php generating xml. need to read and generate a treeview based on xml output

I have a PHP page, xml_gen.php which generates XML as output from
a read from a query to an Oracle database. I have attached the
page I am using to generate the xml output (xml_gen.txt is really xml_gen.php), and a sample of the output as xml.

What I need to do is create a treeview folder structure based
off this xml output. I have looked for some treeview .js libraries
and many are great for rendering the tree if i save the output
as an XML file and then feed the XML file to the tree routine.

What I really need is to be able to generate the tree from the
xml_gen.php output directly.

I had thought about sending the output to a session variable and
then reading the session into the tree routine but I am not sure
how to write that.

Does anyone have an idea as to how i would go about creating a
treeview structure from a read of the xml_gen.php page?