title: error on line 1 at column 6: XML declaration allowed only at the start of the document
body: <p>I was trying to build an XML file. But stuck with an error. I am including the code and error. Thanks in advance.</p>
  
  <pre><code>    &lt;?php 
      mysql_connect("localhost", "root", "") or die(mysql_error()); 
      mysql_select_db("comrade") or die(mysql_error()); 
      $data = mysql_query("SELECT * FROM support WHERE DATE(`date`) = CURDATE()") 
      or die(mysql_error());
      $xml = new SimpleXMLElement('&lt;xml/&gt;');
      while($info = mysql_fetch_array( $data )) 
       { 
        $support = $xml-&gt;addChild('support');
        $support-&gt;addChild('cus_name',$info['com_name']);
        $support-&gt;addChild('ser_type',$info['ser_type']);
       } 
  
       Header('Content-type: text/xml');
       print($xml-&gt;asXML());
       ?&gt;
  </code></pre>
  
  <p>It showing the following error</p>
  
  <pre><code>     Below is a rendering of the page up to the first error.
  </code></pre>