# Set text content of XML node

**URL:** https://forum.kirupa.com/t/set-text-content-of-xml-node/268298
**Category:** flash
**Created:** [August 12, 2008, 12:13pm UTC](https://forum.kirupa.com/t/set-text-content-of-xml-node/268298 "2008-08-12T12:13:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mulux](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@mulux](https://forum.kirupa.com/u/mulux)
#### Post date: [August 12, 2008, 12:13pm UTC](https://forum.kirupa.com/t/set-text-content-of-xml-node/268298/1 "2008-08-12T12:13:01Z")

</div>

I would like to know if it is possible to set the text content of a XML root node.

For a child node we can do this:

```auto
var xml:XML = <root><child /></root>;
xml.child = "kirupa";

```

When initializing we can do this:

```auto
var xml:XML = <root>{variable}</root>;

```

But is there any way to change the text content of the root node after initialization? This will not work:

```auto
var xml:XML = <root />;
xml = "test";

```

Thank you for your help!
