Sample XML file generator.

Well-formed record documents with a proper declaration and escaped values. Pretty-printed or compact. Free, no sign-up, instant download.

About generating XML files

Well-formed by construction

Files open with an XML declaration and contain a single root element wrapping repeated record elements — one child element per field, with special characters correctly escaped as entities. It’s the classic data-exchange shape that enterprise importers, feed processors, and legacy integrations have consumed for decades, and it parses cleanly in any conformant XML library.

Pretty-printed or compact

With pretty print on you get indented, reviewable XML for fixtures and documentation. Off, the same document collapses to a compact single-line form — the version that trips up code doing line-based processing or assuming whitespace between elements. XML is where a lot of old systems live; testing both serializations of identical data is cheap insurance.

What people test with it.

Legacy integrations

Enterprise and B2B systems still speak XML — generate test payloads without waiting on a partner.

Parser testing

Escaped entities and both serializations exercise DOM, SAX, and streaming parsers properly.

Transformation pipelines

Known input for XSLT and XML-to-JSON converters, with records realistic enough to spot mapping mistakes.

Import validators

Well-formed baseline files for testing structure validation and error messages.

Other file formats.

Every format below opens the same generator, preconfigured. Or start from the full file generator.

XML generator FAQ

Is there a schema (XSD/DTD) for the generated files?

No schema is included or referenced — the files are well-formed but not tied to a validation document. The structure is regular enough that writing a small XSD against a generated sample takes minutes if your test needs one.

How are special characters handled?

Escaped per the XML spec — angle brackets, ampersands, and quotes in values become entities. Generated data includes values that need escaping, so your parser’s entity handling gets exercised without hand-crafted input.

Attributes or child elements?

Child elements — every field is its own element inside its record. That’s the more common shape for data exchange and maps 1:1 when converting to and from JSON.