.xml file format

XML Tools and Resources

View, format, inspect, merge, and learn how XML files are used for structured data, documents, configuration, feeds, and software workflows.

Format

XML

.xml

Original files stay unchanged. Tools download a new file when output is generated.

Popular XML Tools

Every tool listed here works with .xml files and runs in your browser. If the task you need is not here, the related formats below may cover it.

Well-formed and valid are different tests

Well-formed means the syntax is correct: one root element, every tag closed, attributes quoted, reserved characters escaped. Valid means the document also conforms to a schema — a DTD, XSD, or Relax NG — that says which elements may appear where. A document can be perfectly well-formed and still wrong for its purpose.

Encoding and escaping cause most breakages

The XML declaration states the encoding, and a mismatch between that declaration and the actual bytes produces failures that look like corruption. Inside content, the ampersand and angle brackets must be escaped as entities; an unescaped ampersand in a URL query string is one of the most common ways a feed or export becomes unparseable.

Namespaces exist so vocabularies can mix

Namespace prefixes let one document combine elements from several specifications without name collisions. They are also why an XPath expression that looks correct returns nothing: the query has to be namespace-aware to match elements that are namespace-qualified.

FAQ

Why does my XML fail to parse?

Usually an unescaped ampersand or angle bracket in text, an unclosed tag, more than one root element, or a declared encoding that does not match the file's actual bytes.

What is the difference between XML and JSON?

XML has attributes, namespaces, comments, and schema languages, which suits documents and mixed content. JSON maps directly onto simple data structures and is more compact for APIs.

Does formatting XML change its meaning?

Adding indentation adds whitespace text nodes. That is harmless for most data documents but significant where whitespace is meaningful, such as inside mixed content or a preserve-space element.

Related Resources