# XML Module

* [Definition](#definition)
* [Configuring the XML module](#configuring-the-xml-module)
  * [Convert XML to JSON operation](#convert-xml-to-json-operation)
  * [Convert JSON to XML operation](#convert-json-to-xml-operation)
    * [Parameters](#convert-json-to-xml-operation)

### Definition <a href="#definition" id="definition"></a>

The **XML** tool module, standard module for use in any flow, was created to convert data from the **XML** file format to **JSON** and vice versa.

The XML module consists of two operations, **Convert XML to JSON** and **Convert JSON to XML**.

### Configuring the XML module <a href="#configuring-the-xml-module" id="configuring-the-xml-module"></a>

The **XML** module appears in the **Tools** option when editing a flow. When added to the flow, it offers two operations:

**Convert XML to JSON**: converts an XML spreadsheet to JSON format.

**Convert JSON to XML**: converts a spreadsheet in JSON to XML format

<figure><img src="/files/y3KiapsyLvIO34avB1SZ" alt=""><figcaption></figcaption></figure>

#### Convert XML to JSON operation <a href="#convert-xml-to-json-operation" id="convert-xml-to-json-operation"></a>

This operation allows you to convert an **XML** table with different items (products, customers, etc.) into JSON format, so that this information can be used later in the flow.

To use this option, choose "**Convert XML to JSON"** and then click "**Save"**.

To configure the variables, click on "**Edit**" in the newly created component.

<figure><img src="/files/CtEzVLxwFgeGOZJvB6H7" alt=""><figcaption></figcaption></figure>

Where:

* **XML**: enter the code in XML format that needs to be converted
* **Attribute symbol:** enter the desired symbol for the JSON code; by default, "$" (dollar sign) is used
* **Character symbol:** enter the desired symbol for the JSON code; by default, "\_" (underline) is used.
* **XML CONVERTED TO JSON**: here, after you click on the **Validate** button, the XML converted to JSON format will be displayed

XML example:

```markup
<?xml version="1.0" encoding="UTF-8"?>
<root>
   <element>
      <id>1</id>
      <name>Jaleco</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
   <element>
      <id>2</id>
      <name>Avental</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
   <element>
      <id>3</id>
      <name>Touca</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
   <element>
      <id>4</id>
      <name>Fronha</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
   <element>
      <id>5</id>
      <name>Embalagem</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
   <element>
      <id>6</id>
      <name>Porta talher</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
   <element>
      <id>7</id>
      <name>Porta absorvente</name>
      <description>Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes</description>
      <price>R$ 999,99</price>
      <available>true</available>
   </element>
</root>
```

#### Convert JSON to XML operation <a href="#convert-json-to-xml-operation" id="convert-json-to-xml-operation"></a>

This operation allows you to convert a JSON table with different items (products, customers, etc.) into XML format, so that this information can be used later in the flow.

To use this option, choose "**Convert JSON to XLM"** and then click "**Save"**.

To configure the variables, click on "**Edit**" in the newly created component.

<figure><img src="/files/IrwplgckbuZnRkGV9yO9" alt=""><figcaption></figcaption></figure>

Where:

* **Attribute symbol:** enter the desired symbol for the JSON code; by default, "$" (dollar sign) is used.
* **Character symbol:** enter the desired symbol for the JSON code; by default, "\_" (underline) is used.
* **JSON**: enter the code in JSON format that needs to be converted
* **JSON CONVERTED TO XML**: here, after you click on the "**Validate"** button, the JSON converted to XML format will be displayed.

JSON example:

```json
[
   {
      "id":1,
      "name":"Jaleco",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":2,
      "name":"Avental",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":3,
      "name":"Touca",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":4,
      "name":"Fronha",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":5,
      "name":"Embalagem",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":6,
      "name":"Porta talher",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   },
   {
      "id":7,
      "name":"Porta absorvente",
      "description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
      "price":"R$ 999,99",
      "available":true
   }
]
```

To finish configuring the module, click on "**Save**".

**Parameters**

Each operation has its own parameter, which corresponds to the product of the conversion: **JSON** for the **Convert XML to JSON** operation and **XML** for the **Convert JSON to XML** operation. When used, they produce the resulting code, which can later be manipulated by the [**Data Transformation**](/english/skyone-studio/integrations/flows/tool-modules/data-transform-module.md) module or by using a [**SMOP**](/english/skyone-studio/integrations/flows/data-operations/smop-small-operations.md).

Both parameters will appear on the left-hand side of the configuration modal for each operation in the flow, as long as the operations are all connected by lines in the flow.

{% hint style="info" %}
[Find out about the Module Header here](/english/skyone-studio/integrations/flows/module-header.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skyone.cloud/english/skyone-studio/integrations/flows/tool-modules/xml-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
