title: XMLReader reports "Extra content at the end of the document" on an almost empty xml file
body: <p>I've problems using XMLReader on our live server while everything runs smoothly on our development servers. XMLReader always throws a "parser error : Extra content at the end of the document" while reading a xml file. Regardless if it contains thousands of elements or just one line.</p>
  
  <pre><code>$reader = new \XMLReader();
  $reader-&gt;open($xmlFileName, 'UTF-8');
  while ( $reader-&gt;read() ) { ... do nothing ... }
  $reader-&gt;close();
  </code></pre>
  
  <p>The xml looks like this in its most simple form:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;data&gt;&lt;articles&gt;&lt;![CDATA[test]]&gt;&lt;/articles&gt;&lt;/data&gt;
  </code></pre>
  
  <p>Every xml validator says it's well-formed but the errors are still thrown.</p>
  
  <p>The only difference I can spot between our development and our live system is that our development system (Ubuntu) has the libxml2 version 2.7.16 while the live system (CentOs) has 2.6.16. Could this be the cause?</p>