title: Escaping special characters in XML 1.0 using java
body: <p>A third party system is sending an XML file having '&amp;' character in data. They are not even using CDATA. (Poorly designed system it is).</p>
  
  <p>In Java, how to read that XML file and escape the &amp; and other special  characters (&lt;, >, ", ')?</p>
  
  <p>I know this question has been asked many times, but here we don't have any control over the third party system. So how we can read that "invalid" XML file and make it a valid one?</p>
  
  <p>** I'm not able to use SAX/DOM parser as it considers the input file an invalid one.</p>