Well-formed XML test data
XML is still everywhere: enterprise integrations, SOAP services, product feeds, configuration files and document formats. When you build or test code that reads XML, you need sample documents with realistic content. This random XML generator creates a complete document with an XML declaration, a root element and one child element per record.
Example output from the random XML generator
<?xml version="1.0" encoding="UTF-8"?>
<records>
<record>
<id>1</id>
<fullName>Hannah O'Connell</fullName>
<email>hannah.oconnell@hotmail.com</email>
<company>Brekke and Sons</company>
<city>North Kaylee</city>
<date>2024-11-02</date>
</record>
</records>Each field becomes an element named after it. Special characters are escaped (& becomes &, < becomes <), so the output stays well-formed whatever the values contain. That makes it a useful check that your parser decodes entities correctly.
Available fields
Type a comma-separated list of field names in the order you want the columns. Unknown names produce an error listing all valid ones. The full list is:
id, uuid, firstName, lastName, fullName, name, gender, email, username, password, phone, company, jobTitle, street, city, state, zip, country, countryCode, latitude, longitude, date, datetime, birthdate, age, boolean, active, number, price, product, ip, url, color, word, sentence, paragraph, avatar, iban, currencyid is a sequential number starting at 1, uuid is a random version 4 UUID, age is between 18 and 90, date and datetime fall within the past five years, and number is an integer from 0 to 10,000. Names, addresses, companies and products come from an English-language fake-data library.
Ideas for using random XML
- Import testing – verify that an XML import maps each element to the right database column.
- XPath practice – generate a few hundred records and query them in the XPath tester, for example
//record[age > 60]/fullName. - XSLT development – transform the records into HTML or another XML schema.
- Performance – 5,000 records produce a document large enough to compare DOM and streaming parsers.
- Format conversion – turn the data into JSON with XML to JSON to test both code paths with identical content.
Customizing the structure
The generator uses <records> as the root and <record> for each item, with all values as child elements rather than attributes. If your schema needs different element names, attributes or namespaces, a quick search-and-replace in your editor usually does the job, and you can then check the result in the XML validator.
Privacy
All data is fictional and generated in your browser. Email addresses use common provider domains, so treat them as placeholders and never send messages to them.