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…


…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]";

…but that doesn’t work.