> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/types/xml.md).

# xml

This type represents an XML Object in BoxLang

## Xml Methods

<details>

<summary><code>bxDump(label=[string], top=[numeric], expand=[boolean], abort=[boolean], output=[string], format=[string], showUDFs=[boolean])</code></summary>

Outputs the contents of a variable (simple or complex) of any type for debugging purposes to a specific output location.

, The available ,`,output,`, locations are: - ,**,buffer,**,: The output is written to the buffer, which is the default location. If running on a web server, the output is written to the browser. - ,**,console,**,: The output is printed to the System console. - ,**,Absolute File Path,**, The output is written to a file with the specified absolute file path. ,

,

The output `format` can be either HTML or plain text.

The default format is HTML if the output location is the buffer or a web server or a file, otherwise it is plain text for the console.

Arguments:

| Argument   | Type      | Required | Default |
| ---------- | --------- | -------- | ------- |
| `label`    | `string`  | `false`  | `null`  |
| `top`      | `numeric` | `false`  | `null`  |
| `expand`   | `boolean` | `false`  | `true`  |
| `abort`    | `boolean` | `false`  | `false` |
| `output`   | `string`  | `false`  | `null`  |
| `format`   | `string`  | `false`  | `null`  |
| `showUDFs` | `boolean` | `false`  | `true`  |

</details>

<details>

<summary><code>childPos(childname=[string], n=[integer])</code></summary>

Gets the position of a child element within an XML document object.

The position, in an XmlChildren array, of the Nth child that has the specified name.

Arguments:

| Argument    | Type      | Required | Default |
| ----------- | --------- | -------- | ------- |
| `childname` | `string`  | `true`   | `null`  |
| `n`         | `integer` | `true`   | `null`  |

</details>

<details>

<summary><code>clone()</code></summary>

Clone this XML object

</details>

<details>

<summary><code>getNodeType()</code></summary>

Get XML values according to given xPath query

</details>

<details>

<summary><code>keyExists(key=[any])</code></summary>

Tests whether a key exists in a struct and returns a boolean value

Arguments:

| Argument | Type  | Required | Default |
| -------- | ----- | -------- | ------- |
| `key`    | `any` | `true`   | `null`  |

</details>

<details>

<summary><code>search(xpath=[String], params=[Struct])</code></summary>

Get XML values according to given xPath query

Arguments:

| Argument | Type     | Required | Default |
| -------- | -------- | -------- | ------- |
| `xpath`  | `String` | `true`   | `null`  |
| `params` | `Struct` | `false`  | `{}`    |

</details>

<details>

<summary><code>transform(XSL=[String], parameters=[Struct])</code></summary>

Get XML values according to given xPath query

Arguments:

| Argument     | Type     | Required | Default |
| ------------ | -------- | -------- | ------- |
| `XSL`        | `String` | `true`   | `null`  |
| `parameters` | `Struct` | `false`  | `{}`    |

</details>

## Examples


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/types/xml.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
