How to convert XML to a flat text file? Is there a reusable class available for extracting specific tag values and its attributes and to form a text file with the data.

Luigi Viggiano

I think the better way to do that is to use an XSLT processor that lets you to transform an XML document to any format included html, pdf, or of course simple text. I suggest you to learn more about XSL/XSLT.