Convert String to XML Reference

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…


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…


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

…but that doesn’t work.

Thanks.