I'm writing the contents of an object to a XML file via XML serialization. I then want to read the contents of this file and populate a treeview. The data in the file is not really in a hierachical order so I can don't think I can use the XML DOM. I think I need a recursive function to go through the object (deserialized from the XML file) getting the levels, etc. to populate the tree view.

The xml file looks like this:

<ObjectList>

<Node id="0" parent_id="-1" type="Root" name="New Root Item" level="0" path="" call_number="" comments="" />
<Node id="0" parent_id="0" type="Child" name="New Child Item" level="1" path="" call_number="" comments="" />
<Node id="0" parent_id="0" type="Object" name="New Object Item" level="2" path="" call_number="" comments="" />
</ObjectList>
Which should give a treeview like this:
New Root Item -> New Child Item -> New Object Item