title: web api download xml + HttpResponseMessage
body: <p>I use web api to return a list of items in a xml file. It works.</p>
  
  <p>This is my method : </p>
  
  <pre><code>/// &lt;summary&gt;
  /// Gets the product by division identifier.
  /// &lt;/summary&gt;
  /// &lt;param name="id"&gt;The div identifier.&lt;/param&gt;
  /// &lt;param name="userId"&gt;The user identifier.&lt;/param&gt;
  /// &lt;returns&gt;A Xml file flow&lt;/returns&gt;
  [ActionName("Divisionxml")]
  public HttpResponseMessage GetProductByDivisionIdXml(int id, int userId)
  {
      var result = new HttpResponseMessage(HttpStatusCode.OK);
      var adoria = new Adoria(....);
      var serializer = new XmlSerializer(typeof (Adoria));
  
      var builder = new StringBuilder();
      using (var writer = new StringWriter(builder))
      {
          serializer.Serialize(writer, adoria);
  
          result.Content = new StringContent(builder.ToString(), Encoding.UTF8, "application/xml");
          result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
                                                                  {
                                                                      FileName =
                                                                          string.Format("export_product_{0}.xml", id)
                                                                  };
  
          return result;
      }
  
      return new HttpResponseMessage();
  }
  </code></pre>
  
  <p>The xml file is uploaded and automatically downloading by the browser. Nice.
  But there is a first line in th exml file : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  </code></pre>
  
  <p>I don't know why. I allow the display directly on the browser, and this line doesn't appear...</p>
  
  <p>Do you have some suggestions ?</p>