Just curious, are you sending this output to a XML file or something else where the indenting really matters? The initial 1.5 implementation of these classes had many issues but everything works fine from 1.6 on. Some time ago I was very concerned about formatting my XML in order to have it properly displayed... Copy the LSSerializer example in the FAQ, chop the "..." bit and add it is not true that you can do that with jdk only. it depends on some internal registry implementation that is not active with my jdk7u72 by default. See xerces.apache.org/xerces2-j/faq-general.html#faq-6. Yes this is a Xerces FAQ but the answer covers standard JDK classes. If you don't want to add this external dependency then you can simply use the standard jdk libraries (which actually are built using xerces internally).
The input document contains an extra attribute which has not been defined in the XML Schema, this shows that the XML Schema has been used for the validation.
Namespaces have been introduced to XML after the first specification of XML had received the official W3C Recommendation status.
This is the reason why (most of the) XML parser implementations do not support XML Namespaces by default, to handle the validation of XML documents with namespaces correctly it is therefore necessary to configure the underlying parsers to provide support for XML Namespaces.
To report errors, it is necessary to provide an Error Handler to the underlying implementation.
The Error Handler used for the examples is a very simple one which reports the error to and continues until the XML document has been fully parsed or until a fatal-error has been reported.