title: Checking if a xml is well formed in java and return all the errors
body: <p>I need to check if a given XML is well-formed or not, like if all tags are properly closed or not and there is no junk at the end of the XML.
  And I also need it to report all errors in the XML. I need to do this validation in java</p>
  
  <p>For example</p>
  
  <pre><code>&lt;Hello&gt;
      &lt;title&gt;Today is a wonderful day &lt;/title&gt;
      &lt;car&gt;
          &lt;type&gt;SUV
      &lt;car&gt;
          &lt;type&gt;van&lt;/type&gt;
      &lt;/car&gt;
  &lt;/Hello&gt;
  &lt;/type&gt;
  &lt;/car&gt;
  </code></pre>
  
  <p>So the above xml must report the error that there is junk at the end of file and that car and type tags are not closed properly at the given line number</p>