.XML

Sample XML Files

Real-world XML documents for testing parsers, feeds, integrations and validation, from a short record to a 10 MB catalog.

.xmlapplication/xml8 filesFree · No sign-upUnlimited downloads
Custom size by Technology Channel · Free to use for testing and development, including commercial projects.

All XML sample files

8 files, 366 B – 9.0 MB. Click a file to download it again any time.

Simple documentPopular

sample.xml

Small, well-formed XML with attributes, child elements and a comment. A quick parser sanity check.

  • 5 elements
  • Attributes
  • 1.5 KB

Catalog (1,000 books)

sample-catalog-1000.xml

A book catalog with IDs, ISBNs, attributes and nested elements. Good for XPath and import tests.

  • 1,000 records
  • Attributes
  • 366 KB

RSS 2.0 feed

sample-rss.xml

Valid RSS 2.0 feed with 10 items, GUIDs, dates and an Atom self link. Use it to test feed readers.

  • RSS 2.0
  • 10 items
  • 5.0 KB

XML sitemap

sample-sitemap.xml

Valid sitemap protocol file with 11 URLs. Handy for SEO tools and crawler tests.

  • Sitemap 0.9
  • 11 URLs
  • 2.4 KB

SOAP 1.1 envelope

sample-soap.xml

A SOAP response with header, body, namespaces and xsi types. Use it to mock legacy web services.

  • SOAP 1.1
  • Namespaces
  • 1.2 KB

Namespaces and CDATA

sample-namespaces.xml

Default and prefixed namespaces, CDATA sections, entities, xml:lang and a processing instruction.

  • 4 namespaces
  • CDATA
  • Entities

Invalid XML (error test)

sample-invalid.xml

Deliberately broken: duplicate attribute, unescaped &, mismatched and unclosed tags, unquoted attribute, two roots.

  • Malformed
  • Error handling
  • 366 B

Large (40,000 records)

sample-large.xml

About 10 MB of records for streaming (SAX/StAX) parsers, memory and upload tests.

  • 40,000 records
  • Large
  • 9.0 MB
Exact-size generator

Need a XML of a different size?

Create a valid XML file of any exact size, byte for byte, right in your browser. Nothing is uploaded, and you can generate as many as you like.

  • Perfect for upload limits: 9.99 MB, 10 MB and 10.01 MB in seconds.
  • Up to 20 copies at once, bundled in one ZIP.
  • Unique copies get different checksums, for duplicate-detection tests.

Use cases

What you can test

  • DOM versus streaming (SAX or StAX) parsing on the 10 MB file.
  • Namespace handling and CDATA sections.
  • RSS feed readers and podcast tools.
  • Sitemap validation.
  • SOAP clients and legacy integrations.
  • Error handling with the malformed file.
  • XPath queries and XSLT transforms.
Reference

XML format facts

Extension.xml
MIME typeapplication/xml
File signatureNone (plain text, often starts with 3C 3F 78 6D 6C <?xml)
OriginW3C, 1998 · XML 1.0
Files here8 · 9.4 MB in total
LicenseFree for any use, no attribution
About the format

What is a XML file?

XML (Extensible Markup Language) became a W3C recommendation in 1998. It describes structured data with nested, named elements and attributes, and it powers RSS, sitemaps, SOAP, SVG and Office documents.

Parse untrusted XML with external entities disabled. Entity expansion and external references are the root cause of XXE attacks.

Developers

Parse with Python

Parse with Python
import xml.etree.ElementTree as ET

root = ET.parse("files/xml/sample-rss.xml").getroot()
for item in root.iter("item"):
    print(item.findtext("title"))
Download with cURL
curl -O https://samplefiles.technologychannel.org/files/xml/sample.xml
FAQ

XML files: common questions

Do the files contain external entities?

No. They are safe to parse with any XML library. Still, keep external entity resolution turned off for untrusted input.

What is wrong with the invalid XML file?

It has mismatched and unclosed tags and an unescaped ampersand. A conforming parser must stop with a well-formedness error.

Can I use these XML files in commercial projects?

Yes. Every XML file here is free for any use, including commercial testing, demos and tutorials. No attribution is required.

Can I download the same XML file more than once?

Yes, as many times as you like. There is no sign-up, no daily limit and no waiting timer. Direct links also work in scripts, CI jobs and automated tests.