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
Common Use
REST and SOAP API responses
Common Use
RSS and Atom feed files
Common Use
Configuration files (pom.xml, web.xml)
Common Use
Document formats (docx, xlsx are ZIP files containing XML)
Examples
Serve files with the application/xml MIME type:
# Nginx
location ~ \.xml$ {
add_header Content-Type "application/xml";
}
# Apache
AddType application/xml .xmlUse 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:
application/json
The standard MIME type for JavaScript Object Notation (JSON) data interchange.
application/pdf
The MIME type for PDF (Portable Document Format) documents.
application/zip
The MIME type for ZIP archive files used for compression and bundling.
application/octet-stream
The generic MIME type for arbitrary binary data, often used for unknown file types or forced downloads.
application/x-www-form-urlencoded
The MIME type for URL-encoded form data submissions.
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.