Hey,

I have written a function which logs into an FTP server and recursively lists all of the directories within a given folder into an XML string (example below).

I basically want to parse this into a listview item in the format as follows "Level1/level2/level3/level4" (standard file path). I have given an example of the xml below. How would I go about achieving this?

I have set up an xmltextreader, and then using a do while xmltextreader.read() I can check the current level of the node and add it that way, but it tends to only work half the time - is this the best approach?

Code:
<dirTree>
<dir name="Highest level" />
<dir name="Highest Level 2">
    <dir name="level 2" />
    <dir name="level 2a" />
    <dir name="level 2b">
        <dir name="level 3" />
    </dir>
    <dir name="level 2c" />
</dir>
<dir name="Highest Level 3" />
<dir name="Highest Level 4" />
</dirTree>
Code:
Highest Level
Highest Level 2
Highest Level 2/level 2
Highest Level 2/level 2a
Highest Level 2/level 2b
Highest Level 2/level 2b/level3
Highest Level 2/level 2c
Highest Level 3
Highest Level 4
Regards,

Adam.