I'm not sure why you are asking this on an XSLT forum.
There are extension functions in Saxon that convert strings to base64, if this is any use to you.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference