This kind of thing is very easy in XSLT 2.0 using xsl:analyze-string.
To do it in XSLT 1.0 you need to write a recursive template. Supply the string as a parameter to the template. If the string is empty, exit. If the first two characters are "\t", output a <tab/> element, otherwise output the first character. Then call the template recursively passing the rest of the string as the parameter value.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference