# XML Node Variables?

**URL:** <https://forum.kirupa.com/t/xml-node-variables/282970>\
**Category:** flash\
**Created:** [February 28, 2009, 7:20pm UTC](https://forum.kirupa.com/t/xml-node-variables/282970 "2009-02-28T19:20:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpha\_Remex](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alpha\_Remex](https://forum.kirupa.com/u/Alpha_Remex)\
**Post date:** [February 28, 2009, 7:20pm UTC](https://forum.kirupa.com/t/xml-node-variables/282970/1 "2009-02-28T19:20:34Z")

</div>

So I have a ton of loops that look into different levels of nodes in my XML database. Here is an example:

```auto

var db:XML;

...*loading the database code...*

for each(var option:XML in db.team.rep.number.*) {
    *...lots of code here...*
}

```

My question is… is it possible to take the node level and put it into a variable?

Something like this:

```auto

var db:XML;
var nodeLevel:* = db.team.rep.number.*;

...*loading the database code...*

for each(var option:XML in nodeLevel) {
    *...lots of code here...*
}

nodeLevel = db.team.*;

for each(var option:XML in nodeLevel) {
     *...lots of code here...*
 }

```

Does my question make sense?
