# Sort XML list by attribute

**URL:** <https://forum.kirupa.com/t/sort-xml-list-by-attribute/323685>\
**Category:** flash\
**Created:** [July 12, 2011, 5:44pm UTC](https://forum.kirupa.com/t/sort-xml-list-by-attribute/323685 "2011-07-12T17:44:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RubenDoliveira](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rubendoliveira/32/3905_2.png) [@RubenDoliveira](https://forum.kirupa.com/u/RubenDoliveira)\
**Post date:** [July 12, 2011, 5:44pm UTC](https://forum.kirupa.com/t/sort-xml-list-by-attribute/323685/1 "2011-07-12T17:44:38Z")

</div>

Hi,

I’ve been looking for ideas on how to do this… but every single one seems to have something that does not fit my purpose.

I have a XML list and this is a bit of my AS3 code:

```auto

var classList:XMLList = e.child("class").(attribute("day") == theday).(attribute("hour_ini") >= thehours);
			
for (var i:int = 0; i < classList.length(); i++)
{
    roomElement= classList*;
					
    _container = new container;
    _container.x = stage.stageWidth;
    _container.y = 200 + (i* 95);
    addChild(_container);
					
    TweenLite.to(_container, 1.5, {x: 45 + i % 2 * 45, alpha: 1, ease:Quint.easeOut, overwrite:false});
					
    _container.room.htmlText = roomElement+ "<br />";
  
}

```

Everthing is working, now I just want to order my list by the attribute hour\_ini.

Any ideas??
