title: XDocument: saving XML to file without BOM
body: <p>I'm generating an <em>utf-8 XML</em> file using <code>XDocument</code>.</p>
  
  <pre><code>XDocument xml_document = new XDocument(
                      new XDeclaration("1.0", "utf-8", null),
                      new XElement(ROOT_NAME,                    
                      new XAttribute("note", note)
                  )
              );
  ...
  xml_document.Save(@file_path);
  </code></pre>
  
  <p>The file is generated correctly and validated with an xsd file with success.</p>
  
  <p>When I try to upload the XML file to an online service, the service says that my file is <code>wrong at line 1</code>; I have discovered that the problem is caused by the BOM on the first bytes of the file.</p>
  
  <p>Do you know why the BOM is appended to the file and how can I save the file without it?  </p>
  
  <p>As stated in <a href="http://en.wikipedia.org/wiki/Byte_order_mark" rel="noreferrer">Byte order mark</a> Wikipedia article:</p>
  
  <blockquote>
    <p>While Unicode standard allows BOM in
    UTF-8  <strong>it does not require or
    recommend it</strong>. Byte order has no
    meaning in UTF-8 so a BOM only
    serves to identify a text stream or
    file as UTF-8 or that it was converted
    from another format that has a BOM</p>
  </blockquote>
  
  <p>Is it an <code>XDocument</code> problem or should I contact the guys of the online service provider to ask for a parser upgrade?  </p>