excellent... however it should be noted that you might (as I did) have an outdated version of xalan.jar, with which you will fail at the TransformerFactor.newInstance() call (even though it will not produce any errors in Eclipse). xalan-2.7.0.jar is the right version.
–
Genia S.Feb 3 '09 at 19:46

I put this in the comment, but then thought that for future reference people might find it easier if I actually added it as an answer. So... Joshua.ewer's answer is correct, but requires xalan-2.7.0.jar.