---
title: "str2xml | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Function str2xml

-   str2xml(str: string): [Document](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Document/)[](#str2xml)
    
    create a function that converts a string to XML [https://developer.mozilla.org/en-US/docs/Web/API/DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser)
    
    #### Parameters
    
    -   str: string
    
    #### Returns [Document](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Document/)
