---
title: "xml:create — Create XML"
description: "iXML command xml:create: Create XML."
canonical_url: "https://www.zeyos.com/ixml/ref/xml-create"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/xml-create.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# xml:create — Create XML

XML:CREATE generates a XML document according to the XML 1.0 Specification.

The given variable references the root element and must be an array comprised of the following items:

				Key   Description
				--------------------------------------------------------------
				name  tag name
				attr  array of attributes with associated name and value pairs
				nodes array of child nodes including cdata parts
				cdata cdata value (optionally instead of 'nodes')

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Variable name |
| var_result | var |  | Result variable name |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var_result; type: string

### Examples

```xml
<array var="root">
	<item key="name">html</item>

	<array key="attr">
		<item key="xmlns">http://www.w3.org/1999/xhtml</item>
		<item key="xml:lang">en</item>
	</array>
</array>

<output>
	<xml:create var="root"/>
</output>

<!--
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"/>
-->
```
