But you just didn't use the CODE tag that preserves indenting. I can still guess what you meant.
I looked in the API documentation for the OutputKeys.INDENT constant, and it contained a link to the XSLT Recommendation. Here's what that says about the "indent" attribute:
If the indent attribute has the value yes, then the xml output method may output whitespace in addition to the whitespace in the result tree (possibly based on whitespace stripped from either the source document or the stylesheet) in order to indent the result nicely; if the indent attribute has the value no, it should not output any additional whitespace. The default value is no.
You didn't provide either "yes" or "no" for the value, so the default ("no") was used.