XML Dataset Generator

Runs in browser Test Data

Create XML documents with configurable root/record element names, attributes vs elements, namespaces and record counts for SOAP and integration testing.

TEST DATA ONLY — all generated names, contacts, identifiers and numbers are synthetic and do not belong to real people or accounts.
Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

What makes an XML document well-formed?

An XML document is well-formed when it has exactly one root element, every tag is closed and properly nested, attribute values are quoted, and the five special characters are escaped. Being valid is a stronger property: the document also conforms to a schema or DTD. Formatters and validators check the first; contract tools check the second.

Security note: XML parsers that resolve external entities can be made to read local files or call internal URLs (XXE). Disable DTD processing and external entities in any parser that receives untrusted XML.

How to use XML Dataset Generator

  1. Describe the record fields.
  2. Set root/record names, attribute mode and namespace.
  3. Press Generate and download the XML.

XML Dataset Generator features

  • Field schema shared with the CSV and SQL generators
  • Configurable root and record element names
  • Fields as elements, attributes or mixed (ids as attributes)
  • Namespace URI with optional prefix on every element
  • XML declaration and pretty-printing toggles; always well-formed and escaped
  • Up to 5,000 records, seedable, with preview

XML Dataset Generator example

Product catalogue

Input:

id:id
name:product
price:price:5-900 · Root: catalog · Record: item · Mode: Mixed · Namespace: urn:example:cat (prefix c)

Output:

<?xml version="1.0" encoding="UTF-8"?>
<c:catalog xmlns:c="urn:example:cat" count="2">
  <c:item id="1">
    <c:name>Wireless Keyboard</c:name>
    <c:price>129.5</c:price>
  </c:item>
  …
</c:catalog>

Frequently asked questions about XML Dataset Generator

Can fields be attributes instead of elements?

Yes — choose attributes, elements, or mixed (id-like fields as attributes, the rest as elements).

How do namespaces work?

Give a namespace URI and optionally a prefix; the root declares xmlns (or xmlns:prefix) and every element is prefixed. Special characters are escaped so the document is always well-formed.

Is the output valid XML?

Yes, it is produced by an XML builder with proper escaping and can be validated with the XML Validator tool.

References