Microsoft XML SDK 2.6 - XML Developer's Guide

White Space and the XML Declaration

Each XML document must begin with a special line referred to as the XML declaration. It declares the version of XML to which the file's syntax conforms. At the time of this writing, there is only a version 1.0 of the XML standard. According to the XML 1.0 standard, no white space is allowed before the XML declaration. To prevent errors while loading an XML document, make sure that no white space precedes the XML declaration, as shown in the following example.

<?xml version="1.0"?>
  <BOOK>
    <BOOKNAME>XML</BOOKNAME>
  </BOOK>