In more detail
An XML document has a single root element; elements can contain text, other elements and attributes, and special characters are escaped as entities such as < and &. A document is well-formed when every tag is closed and properly nested, and valid when it also matches a schema (DTD or XSD) that defines which elements are allowed. Namespaces let vocabularies from different sources be mixed without name clashes. XML is more verbose than JSON but still common in office document formats, RSS feeds, sitemaps, SVG images and many enterprise systems.
Why it matters
A single unclosed tag or unescaped & makes the whole document unreadable to a strict parser, unlike HTML, which browsers repair silently. XML parsers that resolve external entities can be tricked into reading local files or making network requests (an XXE attack), so untrusted XML should be parsed with those features turned off.
Example
A small, well-formed document with attributes:
<?xml version="1.0" encoding="UTF-8"?>
<person id="42">
<name>Ana</name>
<email type="work">[email protected]</email>
<note>Tom & Ana</note>
</person>
The same data in JSON would be roughly {"id": 42, "name": "Ana", ...}, but JSON has no separate notion of attributes.