title: Loading a malformed XML in PHP
body: <p>I have an XML doc that I need to load with PHP. I am currently using the simplexml_load_file() function, however the xml file is malformed, and consequently I am getting a parse error.</p>
  
  <p>The XML file looks something like this:</p>
  
  <pre><code>...
  &lt;/result&gt;something1&gt;
  &lt;/else&gt;
  &lt;/else&gt;
  &lt;/resu
  ...
  </code></pre>
  
  <p>As you can see, this XML is whack and this function is throwing an error trying to parse it. Also I don't need this data that is corrupted. I would just like to read in the stuff that I can and throw everything else away.</p>