# XML to JSON Converter

**Use case:** 

Convert XML documents to readable JSON with attributes, nested nodes, and pretty printed output for APIs and data cleanup.

## Input

```json
{
  "inputs": [
    {
      "inputData": "<catalog><book id=\"1\"><title>Dune</title><author>Frank Herbert</author><price>9.99</price></book></catalog>",
      "mode": "xmlToJson"
    }
  ],
  "mode": "xmlToJson",
  "parseAttributes": true,
  "rootElement": "root",
  "prettyPrint": true,
  "arrayNodeName": "item"
}
```

## Output

```json
{
  "inputIndex": {
    "label": "#",
    "format": "number"
  },
  "mode": {
    "label": "Mode",
    "format": "text"
  },
  "outputFormat": {
    "label": "Format",
    "format": "text"
  },
  "inputPreview": {
    "label": "Input Preview",
    "format": "text"
  },
  "output": {
    "label": "Output",
    "format": "text"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## About this Actor

This example demonstrates how to use [XML ↔ JSON Converter](https://apify.com/automation-lab/xml-json-converter) with a specific input configuration. Visit the [Actor detail page](https://apify.com/automation-lab/xml-json-converter) to learn more, explore other use cases, and run it yourself.