# Convert String to XML Reference

**URL:** <https://forum.kirupa.com/t/convert-string-to-xml-reference/293577>\
**Category:** flash\
**Created:** [July 30, 2009, 11:53pm UTC](https://forum.kirupa.com/t/convert-string-to-xml-reference/293577 "2009-07-30T23:53:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsyapril88](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bsyapril88](https://forum.kirupa.com/u/bsyapril88)\
**Post date:** [July 30, 2009, 11:53pm UTC](https://forum.kirupa.com/t/convert-string-to-xml-reference/293577/1 "2009-07-30T23:53:40Z")

</div>

I’m trying to refer to a specific XML node dynamically. Is there any way to convert a string to reference properly? Or is there any other way?

So I want to be able to write…

```auto

trace(myXml.fruits[1].name);

```

…but have the “fruits[1]” stored in a variable so it can be changed easily. It might look something like…

```auto

var special:String = "fruits[1]";
trace(myXml.special.name);

```

…but that doesn’t work.

Thanks.
