I would suggest starting from the build.xml file in the latest9.1 branch of the Subversion repository (which I've just realized I failed to commit - now remedied). You'll need to edit the parameters giving directory locations at the start of the file (and you may find one or two hard-coded ones further down). Get rid of the -bn, -san, and -saj tasks since you're only building the Saxon-B on Java product; you might also want to get rid of unwanted modules such as -jdom, -xom, -dom4j, -xqj, -sql. To reduce risk I would suggest not changing anything that contributes to the main saxon9.jar file even if it's obviously redundant, e.g. XQuery-only code.
 
The most stable source code to use will be the code used to build Saxon 9.0.0.7, which you can get from the latest9.0 branch on Subversion. I have a very conservative approach to patching, it's very rare indeed for a patch to cause any problems. But the 9.1 line is only just out and will probably take a couple of months to reach a similar level of reliability.
 
Specific issues:


  1. Configuration.java line 255 need to be commented: ie. /*DOTNETONLY*/ platform = DotNetPlatform.getInstance();
    (Would be subclasses a solution to avoid commenting?) 
- the Ant build sorts this out for you.
  1. The encoding is not UTF-8, but I assume ISO-8859-1, which caused to me some problems in classes as net.sf.saxon.number.Numberer_frBE.java for our multiplatform builds.
    IDE as NetBeans uses UTF-8 as default encoding, is this encoding a possible step?  
- yes, I guess it must be 8859-1. I use IntelliJ and I'm not sure it gives me any options on this. 
  1. I was wondering: from the manifest it seems you have created the original JAR with 1.5.0_06-b05, but there are build/run-time dependency to JDK6 classes, as often classes from the javax.xml.stream
    package are being used, as http://java.sun.com/javase/6/docs/api/javax/xml/stream/Location.html which was introduced in JDK6. Have I overseen something? 
- This package is also available as a freestanding download (jsr173) for use with JDK 1.4 or JDK 5, which is what I used to compile the code. (Actually, the easiest way of getting these interfaces is to download the Woodstox parser, but you may prefer the official Sun distribution!) There's no need to have the classes available at run-time unless the user explicitly requests use of a pull parser.
 
I may have built the JAR files using 1.5.0_06, but most of the code, with the exception of the s9api package, is actually compiled using JDK 1.4 (or JDK 1.5 in 1.4 mode, I forget which! - check the build file)

BTW compiled with JDK 6 (Netbeans 6.1 with latest JDK 6) the saxon9.jar shrinks from 4,79 MB to 3,64 MB (including the same named class files).  
 
- I suspect you compiled the JAR with compression, and the Saxon build is creating an uncompressed JAR. There was some debate about this on the lists a couple of years ago and people suggested that for the typical mode of use of Saxon, an uncompressed JAR would give faster warm-up time. 
 
Regards,
 
Michael Kay