# Xml as variable

**URL:** <https://forum.kirupa.com/t/xml-as-variable/275957>\
**Category:** Uncategorized\
**Created:** [November 20, 2008, 4:31pm UTC](https://forum.kirupa.com/t/xml-as-variable/275957 "2008-11-20T16:31:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexCorral](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@AlexCorral](https://forum.kirupa.com/u/AlexCorral)\
**Post date:** [November 20, 2008, 4:31pm UTC](https://forum.kirupa.com/t/xml-as-variable/275957/1 "2008-11-20T16:31:12Z")

</div>

I have loaded a XML file on a MC inside my scene and want to use its information (nodes) within different buttons

I loaded it as follow:

```php
 
function loadXML(loaded) { 
if (loaded) { 
_root.Name = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue; 
_root.LName= this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.Number= this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue; 
name_txt1.text = _root.Name; 
comment_txt1.text = _root.LName; 
n=_root.Number
}
else { 
trace("file not loaded!"); 
} 
} 
xmlData = new XML(); 
xmlData.ignoreWhite = true; 
xmlData.onLoad = loadXML; 
xmlData.load("list.xml"); 

```

Can I convert the nodes to variables and can I use them along the hole scene?
