What Is XML?
XML (eXtensible Markup Language) is a markup language designed to store and transport data. Unlike HTML (which defines how data looks), XML defines what data means through custom tags. It remains widely used in enterprise systems, RSS feeds, SOAP web services, Android layout files and Microsoft Office formats.
XML vs JSON
JSON has largely replaced XML for REST APIs because it is lighter and easier to parse. However XML has advantages that keep it relevant: it supports attributes alongside element content, has native namespace support, and is better suited to document-centric data (like Word documents or SVG files).
Common XML Errors
Unlike HTML, XML is strict. Common errors include:
- Unclosed tags — every opening tag must have a corresponding closing tag
- Attribute values without quotes — all attribute values must be quoted
- Illegal characters — characters like < and & must be escaped as
<and& - Missing XML declaration — while optional,
<?xml version="1.0" encoding="UTF-8"?>is best practice
A Security Risk Worth Knowing: XXE Attacks
XML's support for "external entities" — references that can pull in content from a file path or URL when the document is parsed — has been exploited in real, documented attacks (XML External Entity injection) to read arbitrary server files or trigger requests to internal systems just by parsing a maliciously crafted XML document. Most modern XML parsers now disable external entity resolution by default, but older libraries or misconfigured ones can still be vulnerable, which is why any application parsing XML from an untrusted source should explicitly confirm external entity processing is disabled.
A Common Namespace Mistake
Forgetting to declare an XML namespace, or using the wrong namespace prefix, causes elements to silently fail matching in XPath queries or schema validation even though the document itself is well-formed and opens without errors. This is a frequent source of "my XML looks fine but my parser can't find the elements" confusion — the document is valid XML, but namespace-aware tools are matching against the wrong fully-qualified element names.
Why Format XML?
Minified XML (no whitespace or indentation) is efficient for transmission but unreadable for humans. Formatted (beautified) XML uses consistent indentation to make the structure clear. Both represent identical data.
Format and Validate XML Free
Our XML Formatter formats, validates, minifies and converts XML to JSON — all in your browser with no server upload required.


