XML Sort & Search


I am trying to create a XML file & a flash based interface which would:

A) Sort the data on the node specified (I tried, it doesnot sort correctly many times)

b) Search the XML nodes for the text the user inputs and display the data

Say he gets 5 results all five must be displayed.

Can anyone guide me on this one?

Thanks for the help