In XSLT 2.0, use the tokenize() function.
In XSLT 1.0, you can download a recursive template called str:tokenize from
www.exlst.org, and either use it directly in your stylesheet, or use it as a teaching aid to see how the problem is tackled.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference