This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The serialization spec (3.0 and 3.1), XML method with indent="yes", does not allow addition of whitespace after the XML declaration or at the end of the document, or before or after document-level comments and processing instructions. The 2.0 spec did allow such whitespace to be added. I think this is probably an oversight rather than an intentional change. I think users would be upset if I changed my product to conform to this rule. See for example: http://stackoverflow.com/questions/43375117/transformer-transform-writes-the-first-tag-on-the-same-line-as-xml/43379194#43379194 I suggest adding to section 5.1.4: Whitespace characters MAY be added, elided or replaced at any place where it is permitted by the XML grammar provided that it is not in the content of an element (for example, after the XML declaration, or between document-level comments). (This is actually more liberal than the 2.0 spec which does not allow whitespace to be inserted between adjacent top-level comments.)
I missed part of rule 2: Whitespace characters MAY be added ... outside the content of any element.