> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Format to XML

> Converts the context data into an XML string.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Converts the context data into an XML string. Use this when a target system expects to receive XML, for example a SOAP service or an older partner API. It takes the structured data you have built up in your flow and turns it into a single XML document, letting you choose the name of the outer element and decide how text that itself contains markup is written.

This documentation describes: [Schema](/schemas/serializer/xml)

## Fields

<FormField property="rootNodeName" label="Root element name">
  The name of the outer XML element that wraps everything. For example, setting this to `order` produces `<order>...</order>` around your data. Pick the name the receiving system expects.
</FormField>

<FormField property="noCdataWrapping" label="Disable cData wrapping">
  An on/off toggle that controls how text containing markup is written. By default, any value that looks like it contains tags is wrapped in a `<![CDATA[ ... ]]>` block so it passes through untouched. Turn this on to instead escape those characters, so `<b>` is written as `&lt;b&gt;`. Leave it off unless the receiving system specifically dislikes CDATA blocks.
</FormField>

## Sample data

| Field                  | Value   |
| ---------------------- | ------- |
| Root element name      | `order` |
| Disable cData wrapping | off     |

Input:

```json theme={null}
{
    "id": 1024,
    "customer": "Maria",
    "total": 49.95
}
```

Output:

```xml theme={null}
<?xml version="1.0"?>
<order><id>1024</id><customer>Maria</customer><total>49.95</total></order>
```

```json Configuration theme={null}
{
  "prototype": "xml",
  "parameters": {
    "rootNodeName": "order"
  }
}
```
