# Xml

## DictionaryToXml

Creates a XML from Dictionary entries and return the result Xml as string. Structure of the XML is '\<root><>\</>... \</root>'. The is the Entry Key and the Entry Value.

#### Syntax <a href="#pragma-line-6868" id="pragma-line-6868"></a>

```
DictionaryToXml ( Dictionary )
```

#### Parameters <a href="#pragma-line-6874" id="pragma-line-6874"></a>

***Dictionary***\
&#x20;The Dictionary used to generate the Xml.\
&#x20;Type: Dictionary\<Any,Any>

#### Return Type <a href="#pragma-line-6881" id="pragma-line-6881"></a>

String

## InstanceToXml

Creates a XML from an instance and return the result Xml as string. Structure of the XML is '\<root><>\</>... \</root>'. The is the Entry Key and the Entry Value.

#### Syntax <a href="#pragma-line-6890" id="pragma-line-6890"></a>

```
InstanceToXml ( Object )
```

#### Parameters <a href="#pragma-line-6896" id="pragma-line-6896"></a>

***Object***\
&#x20;The Object instance used to generate the Xml.\
&#x20;Type: Object

#### Return Type <a href="#pragma-line-6903" id="pragma-line-6903"></a>

String

## XmlEscape

Escape an input string value to be usable for XML (e.g. `<` to `&lt;`).

#### Syntax

```
String XmlEscape(String Value)
```

#### Parameters

***Value***\
The input string value to escape.\
Type String

#### Return Type

String

## XmlSelectNode

Selects a node via XPath and returns it as a String

#### Syntax

```
XmlSelectNodes ( Xml, XPath )
```

#### Parameters

**Xml**\
&#x20;The XML document as a String.\
&#x20;Type: String

**XPath**\
&#x20;The XPath expression to use.\
&#x20;Type: String

#### Return type

String

## XmlSelectNodes

Selects a list of nodes via XPath and returns them as a list of String.

#### Syntax <a href="#pragma-line-6912" id="pragma-line-6912"></a>

```
XmlSelectNodes ( Xml , XPath )
```

#### Parameters <a href="#pragma-line-6918" id="pragma-line-6918"></a>

**Xml**\
&#x20;The XML document as a String.\
&#x20;Type: String

**XPath**\
&#x20;The XPath expression to use.\
&#x20;Type: String

#### Return Type <a href="#pragma-line-6929" id="pragma-line-6929"></a>

List\<String>

## XmlSelectNodeValue

Selects a value via XPath and returns as a String.

#### Syntax <a href="#pragma-line-6938" id="pragma-line-6938"></a>

```
XmlSelectNodeValue ( Xml , XPath )
```

#### Parameters <a href="#pragma-line-6944" id="pragma-line-6944"></a>

***Xml***\
&#x20;The XML document as a String.\
&#x20;Type: String

***XPath***\
&#x20;The XPath expression to use.\
&#x20;Type: String

#### Return Type <a href="#pragma-line-6955" id="pragma-line-6955"></a>

String

## XmlSelectNodeValues

Selects a list via XPath and returns them as a list of Strings

#### Syntax <a href="#pragma-line-6964" id="pragma-line-6964"></a>

```
XmlSelectNodeValues ( Xml , XPath )
```

#### Parameters <a href="#pragma-line-6970" id="pragma-line-6970"></a>

***Xml***\
&#x20;The XML document as a String.\
&#x20;Type: String

***XPath***\
&#x20;The XPath expression to use.\
&#x20;Type: String

#### Return Type <a href="#pragma-line-6981" id="pragma-line-6981"></a>

List\<String>

## XmlSetNodeValue

Sets the Value of a node identified via XPath and returns the change XML as a String.

#### Syntax <a href="#pragma-line-6990" id="pragma-line-6990"></a>

```
XmlSetNodeValue ( Xml , Path , Value )
```

#### Parameters <a href="#pragma-line-6996" id="pragma-line-6996"></a>

***Xml***\
&#x20;The XML document as a String.\
&#x20;Type: String

***Path***\
&#x20;The XPath expression to use.\
&#x20;Type: String

***Value***\
&#x20;The Value to set.\
&#x20;Type: String

#### Return Type <a href="#pragma-line-7011" id="pragma-line-7011"></a>

String

## XmlToDictionary

Creates a Dictionary from the given XML. Expected pattern of the XML is '\<root><>\</>... \</root>'. The is the Entry Key and the Entry Value of the Dictionary result.

#### Syntax <a href="#pragma-line-7020" id="pragma-line-7020"></a>

```
XmlToDictionary ( Xml )
```

#### Parameters <a href="#pragma-line-7026" id="pragma-line-7026"></a>

***Xml***\
&#x20;The Xml used to generate the Dictionary.\
&#x20;Type: String

#### Return Type <a href="#pragma-line-7033" id="pragma-line-7033"></a>

Dictionary\<Any, Any>


---

# 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.tivity.one/building-an-application/execution/scripting/functions/xml.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.
