Why Aren't XML Declarations Compulsory?

They should be, but history got in the way. An XML declaration adds a lot to the value of a document; it makes it self-identifying, and in the internationalized context, self-unpacking. We couldn't bring ourselves to make them compulsory, though, because quite a lot of existing SGML and HTML documents either are, or could easily be made, well-formed XML documents. This wouldn't be the case, though, if we'd required the XML declaration.

However, in all your new XML documents, you should definitely use an XML declaration unless you have a really good reason not to.

Back-link to spec

Copyright © 1998, Tim Bray. All rights reserved.