Help needed ! Sort random XML elements by date?

Hello,

I need to load random text message from xml to Flash but sorted by attributes “Date”.

Can anyone help me, please ?

thank you !

ActionScript Code:

[FONT=Courier New][LEFT][COLOR=#000000]function[/COLOR] set_the_varCOLOR=#000000[/COLOR]
[COLOR=#000000]{[/COLOR]
total_elements = list_xml.[COLOR=#0000ff]firstChild[/COLOR].[COLOR=#0000ff]childNodes[/COLOR].[COLOR=#0000ff]length[/COLOR] - [COLOR=#000080]1[/COLOR];
btn.[COLOR=#000080]the_text[/COLOR] = list_xml.[COLOR=#0000ff]firstChild[/COLOR].[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR][COLOR=#0000ff]random[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000ff]attributes[/COLOR].[COLOR=#0000ff]text[/COLOR];
[COLOR=#000000]}[/COLOR][/LEFT]
[/FONT]
my [COLOR=#0000ff]list[/COLOR].[COLOR=#0000ff]xml[/COLOR] code:


<?xml version="1.0" encoding= "UTF-8" ?> 
<elements>
<item text = "text message 1" date = "10/10" />
<item text = "text message 2" date = "9/10" />
<item text = "text message 3" date = "9/10" />
<item text = "text message 4" date = "10/10" />
<item text = "text message 5" date = "9/10" />
</elements>