MIME Types

application/xml

The MIME type for XML documents and data interchange.

What Is This?

The application/xml MIME type indicates that the content is an XML (Extensible Markup Language) document. XML is a markup language designed for data interchange and document storage. Unlike text/xml, application/xml implies that the content should not be treated as human-readable text but as structured data.

Common Uses

1

Common Use

REST and SOAP API responses

2

Common Use

RSS and Atom feed files

3

Common Use

Configuration files (pom.xml, web.xml)

4

Common Use

Document formats (docx, xlsx are ZIP files containing XML)

Examples

Server Configuration

Serve files with the application/xml MIME type:

# Nginx
location ~ \.xml$ {
  add_header Content-Type "application/xml";
}

# Apache
AddType application/xml .xml
HTML Usage

Use this MIME type in HTML or HTTP:

Content-Type: application/xml

<!-- HTML reference -->
<link rel="preload" href="file.xml" as="fetch" crossorigin>

Related Entries

More from this reference:

Frequently Asked Questions

What is the difference between application/xml and text/xml?

application/xml treats XML as binary data (preferred for APIs and data interchange), while text/xml treats it as human-readable text. Both are valid, but application/xml is recommended for new implementations.

Should I use application/xml or application/rss+xml for RSS feeds?

Use application/rss+xml for RSS feeds specifically. This gives clients explicit information that the content is an RSS feed. However, application/xml is also valid and widely used.