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
For example
<Hello>
<title>Today is a wonderful day </title>
<car>
<type>SUV
<car>
<type>van</type>
</car>
</Hello>
</type>
</car>
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