title: How to parse invalid (bad / not well-formed) XML?
body: <p>Currently, I'm working on a feature that involves parsing XML that we receive from another product. I decided to run some tests against some actual customer data, and it looks like the other product is allowing input from users that should be considered invalid. Anyways, I still have to try and figure out a way to parse it. We're using <code>javax.xml.parsers.DocumentBuilder</code> and I'm getting an error on input that looks like the following.</p>
  
  <pre><code>&lt;xml&gt;
    ...
    &lt;description&gt;Example:Description:&lt;THIS-IS-PART-OF-DESCRIPTION&gt;&lt;/description&gt;
    ...
  &lt;/xml&gt;
  </code></pre>
  
  <p>As you can tell, the description has what appears to be an invalid tag inside of it (<code>&lt;THIS-IS-PART-OF-DESCRIPTION&gt;</code>). Now, this description tag is known to be a leaf tag and shouldn't have any nested tags inside of it. Regardless, this is still an issue and yields an exception on <code>DocumentBuilder.parse(...)</code></p>
  
  <p>I know this is invalid XML, but it's predictably invalid. Any ideas on a way to parse such input?</p>