# Writing Variables into XML

**URL:** <https://forum.kirupa.com/t/writing-variables-into-xml/306029>\
**Category:** flash\
**Created:** [March 8, 2010, 3:25pm UTC](https://forum.kirupa.com/t/writing-variables-into-xml/306029 "2010-03-08T15:25:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![e\_owen](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@e\_owen](https://forum.kirupa.com/u/e_owen)\
**Post date:** [March 8, 2010, 3:25pm UTC](https://forum.kirupa.com/t/writing-variables-into-xml/306029/1 "2010-03-08T15:25:41Z")

</div>

How can I write variables into new XML? I need to take variables and write them into new XML but that I am getting is the name of the variable I am using, not the value.

```auto

var _label:String = _set.attribute( "containing" ).toString();
_subMenuItems.appendChild( XML(<item><label>_label</label></item> ) );

//
// Outputs 
<item><label>_label</label></item>

```
