Why don't you just include the stylesheet as a resource. You have to deliver something and you could easily include the stylesheet itself at the top level of your jar file. Then you can get a stylesheet from code by creating an input stream.
InputStream in = this.getClass().getResourceAsStream("/myxsl.xsl");
StreamSource src = new StreamSource(in);
Template t = TransformerFactory ...
Of course if you have includes and imports you can do the same trick but create a URIResolver
TransformerFactory fact = TransformerFactory.newInstance();
final Class ref = this.getClass();
fact.setURIResolver (
    new URIResolver(){
        public Source resolve(String href, String base) throws TransformerException{
              InputStream in = ref.getResourceAsStream(href);
              if(in == null) return null;
              StreamSource src = new StreamSource(in);
              return src;
(Above is example only. It needs error handling etc. All stylesheet hrefs need to start with / and must be available at the top of a classpath reference.)
The nice thing about this is that if a customer has a problem with a stylesheet you can easily send them a fixed stylesheet and have them put it in a classpath location where it would be found before the stylesheets packaged with your jar.
----- Original Message -----
From: Nestor Boscan
To: saxon-help@lists.sourceforge.net
Sent: Friday, January 30, 2004 3:20 PM
Subject: [saxon] Examples on how to serialize a Templates object?

I would like to serialize the XSL Templates object so I can load it directly to memory in an application and not provide the XSL document. Is there a way to do this?. Any examples?
Néstor Boscán