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

**URL:** <https://forum.kirupa.com/t/php-generating-xml-need-to-read-and-generate-a-treeview-based-on-xml-output/304606>\
**Category:** Uncategorized\
**Created:** [February 10, 2010, 6:28pm UTC](https://forum.kirupa.com/t/php-generating-xml-need-to-read-and-generate-a-treeview-based-on-xml-output/304606 "2010-02-10T18:28:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwelby](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@pwelby](https://forum.kirupa.com/u/pwelby)\
**Post date:** [February 10, 2010, 6:28pm UTC](https://forum.kirupa.com/t/php-generating-xml-need-to-read-and-generate-a-treeview-based-on-xml-output/304606/1 "2010-02-10T18:28:15Z")

</div>

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?
