Where you still meet XML
- SOAP web services used by banks, insurers, airlines and government systems.
- E-invoicing and finance standards such as UBL invoices and ISO 20022 payment messages.
- Office files: .docx and .xlsx are zip archives full of XML.
- Feeds and sitemaps: RSS, Atom and XML sitemaps.
- Configuration in Java, .NET and Android projects.
Strengths
XML supports attributes, namespaces and formal schemas (XSD) that can validate a document's structure before it is processed, which matters when two organizations exchange contracts or invoices. XSLT can transform XML into other formats.
Weaknesses
It is verbose, slower to parse than JSON and easy to get wrong. XML parsers can also be a security risk: an XML External Entity (XXE) attack tricks a misconfigured parser into reading server files or calling internal URLs, so external entities should be disabled.
Practical advice
For new public APIs, JSON is usually simpler. When an integration partner, regulator or legacy system requires XML, build a small adapter that converts it at the edge so the rest of your code stays in one format.
Questions, answered
Not quite. They share ancestry, and XHTML was an XML version of HTML, but modern HTML has its own looser rules.
Yes, though attributes and mixed content need decisions about how to map them.