XML Minifier
Minify XML Online
XML is used to transfer or to store the data in a format that must follow some rules. An XML file usually has many unnecessary emtpy spaces and lines, this means that XML assets takes longer to be sent to the client. By removing all white spaces and concatenating all lines you can reduce the dimension of XML assets and deliver them faster.
This tool is the answer if you need a compact and valid XML document.
If you want to build a similar tool, take a look at this C# library.