Random XML Generator
Generate random XML documents with realistic fake records.
Available: id, uuid, firstName, lastName, fullName, username, email, phone, age, birthDate, city, country, company, active, balance, score, tags, createdAt
Random XML Generator
Generate random XML documents filled with realistic fake records. Choose the fields, the number of records and the names of the root and record elements. Values can be written as child elements or as attributes, with or without the <?xml ?> declaration.
Example output
With the fields id, firstName, city and the element names users / user, each record becomes a user element containing id, firstName and city children. Switch on attribute mode to get compact one-line records like <user id="1" firstName="Emma" city="Berlin"/>.
Available fields
| Group | Fields |
|---|---|
| Identity | id, uuid, username |
| Person | firstName, lastName, fullName, age, birthDate |
| Contact | email, phone, city, country |
| Business | company, balance, score, active |
| Other | tags (list), createdAt (ISO timestamp) |
Use cases
- Testing XML parsers – check DOM, SAX and StAX code with documents of any size.
- XSLT and XPath practice – transform or query sample data without writing it by hand.
- SOAP and legacy integrations – build payloads for services that still speak XML.
- Import tests – try out database, ERP or CMS importers with consistent structure.
Tips
Element mode is easier to read and supports nested lists; attribute mode is shorter and maps neatly to table rows. All data is fictional: e-mail addresses use example domains and phone numbers use the 555 exchange.
Generated in your browser – nothing is uploaded. Try the XML Beautifier to restyle the output, or the Random JSON Generator for the same records as JSON.
Frequently Asked Questions
Is the generated XML well-formed?
Yes. Special characters are escaped (&, <, >, "), element names are validated, and every record has the same structure, so any XML parser can read the result.
How are list fields such as tags written?
As child elements: the tags field becomes a tags element containing one tag element per value. In attribute mode the values are joined with commas.
Can I change the element names?
Yes. Set the root and record element names, for example customers and customer. Names must start with a letter or underscore and may contain letters, digits, hyphens, dots and underscores.