AS3 XML List Attribute or XML push to Array Attribute Sort

Hi All,

I’m having a tough time with something. I have an XML file that I’ve loaded into my project. Just to keep things short, let’s just say it looks like this:


<cars>
     <car make="Honda" year="2010"> 
              <model>Civic</model>
              <model>Accord</model>
     </car>
     <car make="Nissan" year="2001"> 
              <model>Altima</model>
              <model>Maxima</model>
     </car>
     <car make="Toyota" year="2012"> 
              <model>Prius</model>
              <model>Camry</model>
     </car>
</cars>

What I’m trying to do here is sort by year so that the order is 2001, 2010, and 2012. I’ve been searching how to sort an E4X formatted xmllist and i get a ton of results, but nothing actually works or it’s not exactly what i need. Another thing I tried was pushing each <car> node into an array but I’m unable to grab the @year attribute. I can do either way. Does anyone have some kind of solution to this? Your help is much appreciated.