Using the following simple code:
package test; import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class TestOutput
You could probably prettify everything with an XSLT file. Google throws up a few results, but I can't comment on their correctness.