This isn't quite the same level of integration that you get with Xalan-J, but by far the simplest way of manipulating Java objects with XSL that I've dealt with was to use JAXB to turn the objects to/from XML.
JAXB lets you annotate your Java objects with tags specifying how you want them to appear in their equivalent XML document, then does all the work of translating Java-to-XML and XML-to-Java. Take your Java object, run it through JAXB, run your XSL over it, then run it back through JAXB to get the Java object back.
The benefits of this technique include:
- You are not tied to a particular XSL environment or interpreter. Your
XSL only operates on XML.
- The translation from Java to XML and back again is a core part of the JRE,
and does not require any third party libraries
- You can unit test your XSLs independently of the Java
application environment, by passing in text files and verifying the
output