---
schema_version: "1"
id: 0532b16acdabe60a765f92b014ab075e57e19214d8f74246e3baeebe88c26e18
title: XML in Omnistudio Data Mappers (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_xml_in_dataraptors.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_xml_in_dataraptors.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 127facb1e30ff407105f2e991dd3c0091f7a04288b6ef069d9a2fec676d23e33
description: For the managed package runtime, in addition to JSON, Data Mappers can have XML input and output. The XML format in Data Mappers is an unordered key/value, JSON-like structure.
products:
  - Omnistudio
release: "264"
---
# XML in Omnistudio Data Mappers (Managed Package)

For the managed package runtime, in addition to JSON, Data Mappers can have XML input and output. The XML format in Data Mappers is an unordered key/value, JSON-like structure.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

To specify the order in which the elements of the XML output are serialized, populate the **Expected XML Output** pane with an XML structure that is composed in the desired order.

The following example compares equivalent structures in JSON and XML.

JSON

```
{
  "Root": {
    "#text": "rootValue",
    "@attribute1": "attVal1",
    "#ns": "http://namespace1",
    "#ns#a": "http://namespace2",
    "Child": [{
        "@attribute2": "attval2"
      },
      {
        "#text": "childValue"
      }
    ]
  }
}
```

XML

```
<Root attribute1="attVal1" xmlns="http://namespace1" xmlns:a="http://namespace2">
   rootValue
   <Child attribute2="attval2"></Child>
   <Child>childValue</Child>
</Root>
```

Data Mappers that transform XML to JSON use the following conventions to handle the differences between the formats.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col>
        <col>
        <col>
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d38071e71">
            <p style="margin-bottom:0;">Description</p>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d38071e77">
            <p style="margin-bottom:0;">XML</p>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d38071e83">
            <p style="margin-bottom:0;">JSON</p>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e71 ">
            <p style="margin-bottom:0;">Values in an input XML node are translated to output JSON with the key <code>#text</code>.</p>
          </td>

          <td data-label="XML" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e77 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>&lt;Root&gt;rootValue&lt;/Root&gt;
                    </code></pre>
          </td>

          <td data-label="JSON" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e83 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{
  "Root": {
    "#text": "rootValue"
  }
}</code></pre>
          </td>

        </tr>
        <tr class="">
          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e71 ">
            <p style="margin-bottom:0;">Values in an input XML node are translated to output JSON with a key that is preceded by an at sign (<code>@</code>).</p>
          </td>

          <td data-label="XML" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e77 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>&lt;Root attribute1="attVal1"&gt;&lt;/Root&gt;</code></pre>
          </td>

          <td data-label="JSON" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e83 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{
  "Root": {
   "@attribute1": "attVal1"
  }
}</code></pre>
          </td>

        </tr>
        <tr class="">
          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e71 ">
            <p style="margin-bottom:0;">Namespaces in an input XML node are prepended with <code>#ns</code> in the output JSON.</p>
          </td>

          <td data-label="XML" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e77 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>&lt;Root xmlns="http://namespace1" xmlns:a="http://namespace2"&gt;
&lt;/Root&gt;</code></pre>
          </td>

          <td data-label="JSON" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e83 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{
  "Root": {
"#ns":"http://namespace1",
"#ns#a":"http://namespace2,
  }
}</code></pre>
          </td>

        </tr>
        <tr class="">
          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e71 ">
            <p style="margin-bottom:0;">Colons, which are reserved characters in Data Mapper mappings, are replaced by <code>#</code>.</p>
          </td>

          <td data-label="XML" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e77 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>&lt;Root:Data&gt;data&lt;/Root:Data&gt;</code></pre>
          </td>

          <td data-label="JSON" class="slds-cell-wrap" style="vertical-align:top;" headers="d38071e83 ">
            <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{
  "Root#Data": {
    "#text":"data",
  }
}</code></pre>
          </td>

        </tr>
      </tbody>
    </table>