Fix output formatting of XML generation from XSLT
1) Do not create components.xml using string concatenation
2) Correctly indent and format components.xml document output
Cleanup of code