Example of sorting with XSLT
XML file:
Hill
Phil
100000
Herbert
Johnny
95000
Hill
Graham
89000
XSLF file:
Last:
First:
Salary:
Hire Date:
Source: http://www.xml.com/pub/a/2002/07/03/transform.html
Check predicates here: http://www.w3schools.com/XPath/xpath_syntax.asp for last three nodes.