Exactly. The major point is how to build the treeview which is best accomplished by the route I've explained. Processing the text files, or changing them at output if it's Keith's program, then becomes the next step. We may be stepping backward but then moving forward with a stronger solution and a shift in the problem.
If it's Keith's program that outputs the information, then using the class object that xsd would spit out becomes a simple process - instantiate it, add the values where needed, then serialize it to the xml file. Again, there is no need to write custom code to populate an xml document.
If he has no control over the text files' generation, then he'd need some code to "wash" it as MP explained.
I came into this when R started explaining how to do it with xml and he was way off the mark on how to use xml to populate a treeview. While his approach may work, it was not the simplest or easiest approach. It's about working smarter, not harder.
If Keith comes back saying the files are not his and he needs help "washing" them, then I'll gladly pitch in with that question