Skip to main content





The XMLLoader parses XML-encoded data.

File Extension.xml
MIME Typeapplication/xml, text/xml
File TypeText
File FormateXtensible Markup Language
Data FormatFree format data structure
Decoder TypeSynchronous
Worker Thread SupportNo
Streaming SupportNo

The goal of the XMLLoader is to make it easy for JavaScript applications to access XML formatted data. It is not intended to be a tool for advanced manipulation of XML data, and options provided are focused on making the returned data easier to use in JavaScript applications.


Load XML data into a javascript data structure and preserve the original structure

import {XMLLoader} from '';
import {load} from '';

const data = await load(url, XMLLoader);

Load XML data into a javascript data structure and set options that make the returned data more "JavaScript friendly":

import {XMLLoader} from '';
import {load} from '';

const data = await load(url, XMLLoader, {xml: {uncapitalizeKeys: true, removeNSPrefix: true}});

Data Format

Unstructured, untyped data in the form a tree of JavaScrip objects representing the hierarchy of tags in the XML file.


uncapitalizeKeysbooleanfalseXML tags are typically "PascalCase", JavaScript and JSON prefers "camelCase" fields. This setting uncapitalizes all keys in the parsed data (e.g. ValueList => valueList).
removeNSPrefixbooleanfalseXML tags sometimes have namespace prefixes. These namespaces are inconvenient in JavaScript field names and can be stripped by setting this option (e.g. ogc:Feature -> Feature).


  • It is possible to pass options to the underlying parser, currently fast-xml-parser, however there are no guarantees that will continue to use this underlying parser or continue to support those options.


The XMLLoader is a wrapper around fast-xml-parser.