Quick answer
The closing tag must use the same name as the corresponding opening tag.
XML Mismatched Closing Tag
The closing tag must use the same name as the corresponding opening tag. Case and spelling must match exactly.
Common causes
- Typo in the closing tag (e.g. <Item> opened but </item> closed).
- Wrong nesting: closing an outer tag before an inner one.
- Copy-paste or refactor that changed one tag name but not the other.
How to fix
- Check that every </name> matches the most recent <name>.
- XML is case-sensitive: <Root> and </root> do not match.
- Use an XML validator to see which line has the mismatch.
Examples
Bad
<root> <Item>x</item> </root>
Good
<root> <Item>x</Item> </root>
FAQ
- Is XML tag name case-sensitive?
- Yes. <Root> and </root> are different; the closing tag must match the opening tag exactly.
- How do I find the mismatched tag?
- Use an XML validator; it will report the line and column of the error.
Fix it now
Try in validator (prefill this example)