title: PHP generates spaces before the XML starts
body: <p>I have this problem: I want to generate an xml page from PHP script. The user that want the document can connect to a specific URL with specific parameters. But something not work because I think there are some whitespace chracters between the start of the document and the start of xml declaration:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  </code></pre>
  
  <p>I removed in the code all the characters between <code>&lt;?php</code> and <code>header('Content-Type: text/xml; charset=utf-8');</code> and now look like this:</p>
  
  <pre><code>&lt;?php
  header('Content-Type: text/xml; charset=utf-8');
  
  //ini_set('display_errors', 'On');
  //error_reporting(E_ALL);
  
  include("some_file.php");
  require_once("some_file.php");
  
  // some php code
  
  $xml = new SimpleXMLElement("&lt;response&gt;&lt;/response&gt;");
  
  // other php code
  
  echo $xml-&gt;asXML();
  ?&gt;
  </code></pre>
  
  <p>When I run this script, Firefox gives me this message:</p>
  
  <pre><code>XML Parsing Error: XML or text declaration not at start of entity
  Line Number 1
  </code></pre>
  
  <p>Why does I have this error?</p>