title: XML Parsing error on DOM load
body: <p>I have the xml file below (named as test.xml): </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;films&gt;
  &lt;film&gt;
  &lt;title rating="7.8"&gt;The Three Amigos&lt;/title&gt;
  &lt;category&gt;comedy&lt;/category&gt;
  &lt;director&gt;John Landis&lt;/director&gt;
  &lt;country&gt;United States&lt;/country&gt;
  &lt;/film&gt;
  &lt;film&gt;
  &lt;title rating="9.1"&gt;Brief Encounter&lt;/title&gt;
  &lt;category&gt;romance&lt;/category&gt;
  &lt;director&gt;David Lean&lt;/director&gt;
  &lt;country&gt;Great Britain&lt;/country&gt;
  &lt;/film&gt;
  &lt;/films&gt;
  </code></pre>
  
  <p>Now, when running the below php code, I'm getting an error: </p>
  
  <blockquote>
    <p>"XML Parsing Error: junk after document element <b>Warning</b>:  DOMDocument::load() [domdocument.load0]: I/O warning : failed to load external entity &quot;&quot; in line 5".</p>
  </blockquote>
  
  <p>I have no idea why the error is thrown. Please help.</p>
  
  <pre><code>&lt;?php
  $file = 'test.xml';
  $doc = new DOMDocument();
  
  $doc-&gt;load($file);
  
  
  header("Content-Type: text/xml");
  print $doc-&gt;saveXML();
  ?&gt;
  </code></pre>