# XMLNew

Creates a new empty XML Object

## Method Signature

```
XMLNew(caseSensitive=[boolean])
```

### Arguments

| Argument        | Type      | Required | Description                                                                          | Default |
| --------------- | --------- | -------- | ------------------------------------------------------------------------------------ | ------- |
| `caseSensitive` | `boolean` | `true`   | Whether the identifiers in the XML document ( e.g. dot notation ) are case sensitive | `false` |

## Examples

### The simple xmlnew example

Here, We created myXml by using xmlNew function. Then created root node(sampleXml) for myXml and set the rootnode text

```java
<bx:set myXml = xmlNew() >
<bx:set myXml.XMLROOT = xmlelemnew( myXml, "sampleXml" ) >
<bx:set myXml.SAMPLEXML.XMLTEXT = "This is root node text" >
<bx:dump var="#myXml#">
```

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJyryM2JT8lPLs1NzStRsFWIyM3xSy3X0LTmSinNLdBQqECWBooCAJUEEBk%3D)

```java
xml_document = XmlNew();
dump( xml_document );

```

## Related

* [XMLChildPos](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlchildpos)
* [XMLElemNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlelemnew)
* [XMLFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlformat)
* [XMLGetNodeType](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlgetnodetype)
* [XMLParse](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlparse)
* [XMLSearch](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlsearch)
* [XMLTransform](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmltransform)
* [XMLValidate](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlvalidate)


---

# 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://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/xml/xmlnew.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.
