Hi all,

I am building a Flex application that creates charts. Right now, the source xml comes in this type of format:

<data product="bike" month="Jan" year=2010>1000</data>

Really simple structure. Looping and managing this is pretty easy.

My coworker thinks it may be better to build the xml like this:

<data>
<product=bike>
<month=Jan>
<year=2010>
1000
</year>
</month>
</product>
</data>

I know that you can use E4X to query data in a hierarchical fashion but how robust is it?

What I mean is, the source database queries can be altered by the user so the order of the XML nodes will change. If I write an E4X query to get data using the hierarchy above, it will work. Will it continue to work if the hierarchy changes? Using @Attribute in the first format will always return the correct records regardless of attribute order (how I'm doing it now).

For variable node order, what's the best format, the first or the second?