From: Mark Thomas Date: 2008-06-25T05:48:05+09:00 Subject: Re: Reorder a XML file by distance from a location > So I can compare and sort two items.. > > May I ask how can I sort the whole stuff? The solution works for any number of items. sort() uses <=> during the sorting process, so when you define <=> for your data, you can sort any number of items.