Show us your code and then I can see where you have gone wrong, and help you to get over any learning obstacle you might have. Without knowing where you're stuck, all I can do is give you a potted introduction to the language, and there are plenty of those around already.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference