I can't see what you're doing wrong from this information. Please supply a complete (but minimal) source document and stylesheet, tell us what output you are getting, what XSLT processor you are using, and how you are running it.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference