XML files are read by programs using an XML "parser". A proper XML parser will ignore all whitespace, tabs, line feeds, etc. in an XML document. This means that when producing XML, a program may choose to format the xml in many ways, or even to omit formatting alltogether.
The good news is that properly constructed XML can be re-formatted quite easily with the right software. There are many editors available that can do this. (we like Notepad++ with the XML Tools plug-in) However, in order to "clean" lots of files, as in hundreds or thousands at a time, this becomes impractical.