To add to what the others say, you need to sit down and work out exactly what you expect to generate form your XML data. The reason being that XML is a text-based hierarchically structured data format, and it can be all in a single line: newlines (or any other whitespace) are not required by the XML specification, and "individual items" in XML can span multiple lines of text without any change in the data it encapsulates or an entire array of objects can occupy a single line of text - that's problem number one! The second problem is that the data contained in the XML itself doesn't "lend itself" to a flat file output - which is what an unformatted text file contains. If you look at a "basic XML" file like this example: W3Schools CD Catalog[^] you can see that what it contains isn't readily useful as a text file unless you actually convert that to a formatted file of some form. Just stripp[ing out the XML stuff doesN't give you any useful data:
Empire BurlesqueBob DylanUSAColumbia10.901985Hide your heartBonnie TylerUKCBS
Records9.901988Greatest HitsDolly PartonUSARCA9.901982Still got the bluesGary
MooreUKVirgin records10.201990ErosEros RamazzottiEUBMG9.901997One night onlyBee
GeesUKPolydor10.901998Sylvias MotherDr.HookUKCBS8.101973Maggie MayRod
StewartUKPickwick8.501990RomanzaAndrea BocelliEUPolydor10.801996When a man loves a
womanPercy SledgeUSAAtlantic8.701987Black angelSavage RoseEUMega10.9019951999 Grammy
NomineesManyUSAGrammy10.201999For the good timesKenny RogersUKMucik Master8.701995Big
Willie styleWill SmithUSAColumbia9.901997Tupelo HoneyVan
MorrisonUKPolydor8.201971SoulsvilleJorn HoelNorwayWEA7.901996The very best
ofCatStevensUKIsland8.901990StopSam BrownUKA and M8.901988Bridge of
SpiesT'PauUKSiren7.901987Private DancerTina TurnerUKCapitol8.901983Midt om nattenKim
LarsenEUMedley7.801983Pavarotti Gala ConcertLuciano PavarottiUKDECCA9.901991The dock of
the bayOtis ReddingUSAStax Records7.901968Picture bookSimply RedEUElektra7.201985RedThe
CommunardsUKLondon7.801987Unchain my heartJoe CockerUSAEMI8.201987
(I manually added the line breaks to prevent that showing as a single very long line!) So you need to work out what is in the XML that you are interested in, and how you will "present" that in your resulting file - otherwise it's just a waste of your time and effort!
"I have no idea what I did, but