We can use a J2EE component called a Servlet Filter to filter requests for XML documents.
On the way out, we'll run XSLT and style the document to XHTML.
This uses some code I wrote and is available on the class website.
The code uses JAXP (a standard Java API) to run XSLT on the document.