> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/assistant/custom-functions/xcall-legacy-functions/xmltojson.md).

# XMLTOJSON

Syntax: `CS.SPARK_XMLTOJSON(cellAddressOrValue)`

Convert an XML string into JSON and return it as string.

| Parameter               | Description                                                     |
| ----------------------- | --------------------------------------------------------------- |
| `cellAddressOrValue` \* | Either the address of the cell that contains XML or XML string. |

## Example

Copy the example XML data below and paste it into the cell `A1` of a new worksheet.

```xml
<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
</note>
```

Paste the custom function below and paste it into `A2`:

```excel-formula
=CS.SPARK_XMLTOJSON(A1)
```

You should get the following result:

```json
{
    "note": {
        "to": "Tove",
        "from": "Jani",
        "heading": "Reminder",
        "body": "Don't forget me this weekend!"
    }
}
```
