Finding the one broken tag in an XML file, and the errors that hide behind it
Start with a small file that works: <order> on the first line, <item>Tea</item> indented on the second, and </order> on the third. Paste it in and the result says the XML is well-formed, the root element is <order>, and the document has 2 elements. That count includes the root. Now make the kind of mistake that happens when you edit by hand: change the closing tag on line two to </itme>.
The result turns red. It says "Not well-formed" and gives line 2 and a column, with the parser's own message and a copy of line two underneath. The parser read <item>, then Tea, then a closing tag for an element called itme. Nothing called itme is open, so it stops there. The wording depends on your browser. Chrome says the opening and ending tags do not match, and Firefox says the tag is mismatched. Both point at line 2.
Fix the typo and the result goes back to well-formed. Then try a different mistake: change Tea to "Tea & milk". This looks harmless, but it is not well-formed. In XML, & starts an entity such as & or <, and a bare & followed by a space is not one. The parser stops on the &. Write "Tea & milk" and the file is well-formed again. When a program reads it, it sees "Tea & milk". This is the most common error in XML written by hand or built by joining strings in code.
Some errors are reported later than they happen. Leave out the closing quote in <item sku="A1> and the parser keeps reading the attribute value, past the >, until it finds the next quote or reaches the end. The column it reports can be well after the real mistake. So when the reported spot looks fine, look a little earlier: an unclosed quote, an unclosed comment or a missing > before it are the usual causes. The parser also reports only the first error. Fix it, and the next one, if any, appears.
This tool has limits. It checks well-formedness, not validity. It does not read an XSD schema or a DTD, so a file with the wrong element names, or a missing required attribute, still passes. It uses the parser in your browser, so the exact message and sometimes the column differ between Chrome, Firefox and Safari, though they agree on whether a file is well-formed. And it checks one document at a time, as pasted. To also lay the file out, use the XML Formatter, which runs the same check first.