A recursive loop throughthe file system creating a node for each foldr or file.
You will find the resulting XML much easier to work with if it something like:
Code:
<fileSystem>
<drive name="c:">
<item type="folder" name="folder1">
<item type="file" name="file1"/>
<item type="file" name="file2"/>
<item type="folder" name="folder2"/>
<item type="folder" name="folder3">
<item type="file" name="file3"/>
</item>
</item>
</drive>
</fileSystem>
This will be much easier to search than the example you showed.
You may also want to store the path to each item as an attribute, depending on how you intend to use the results.
--
Joe (
Microsoft MVP - XML)