Mock XML Generator
Legacy enterprise systems, SOAP services, and older integrations still speak XML, and testing them requires realistic, well-formed sample documents. Hand-writing XML is tedious and error-prone, especially when you need dozens of records. This tool generates a valid XML document with a configurable structure and fake typed values in one click.
How it works
The generator builds a document with an XML declaration (<?xml version="1.0" encoding="UTF-8"?>), a single root element, and a configurable number of repeated record elements. Each record carries an id attribute and a fixed set of child elements covering common data types: a name string, an email, an integer quantity, a decimal price, and an ISO 8601 date.
Crucially, all text content and attribute values are escaped against the five XML predefined entities so the result is always well-formed. Literal & becomes &, < becomes <, > becomes >, " becomes ", and ' becomes '. The whole document is assembled and indented in the browser, so nothing is sent anywhere.
Tips and notes
- Validate the output by pasting it into your parser or an online XML validator; it should parse without errors.
- To build a SOAP payload, wrap the generated records in your namespace-qualified
<soap:Body>element. - Increase the row count to stress-test streaming parsers and memory usage on large documents.
- The escaping rules here are the XML 1.0 predefined entities; CDATA sections are not used so the output stays simple and predictable.