We use Cocoon to generate presentation, exactly what it is designed for.
The following describes the architecture in brief -
Cocoon is registered as the Servlet to handle all web requests matching a specific URL pattern in the web.xml file. Stand-alone custom Java classes called "producers" are registered with Cocoon. Cocoon intercepts user requests and delegates them to producers. Producers generate XML documents, after doing some business processing by communicating with the business facades. The XML document is generated on the fly using DOM. Many chunks of the document produced by many components called by the producer are finally assembled into one big document and passed back to Cocoon. Cocoon looks at the document, extracts the stylesheet( stored as a resource somewhere ), applies the transformation and produces a presentable format such as HTML, WML, VoiceXML etc. Another pluggable layer of stand-alone custom Java classes called "processors" intercept the transformation process to amend the transformed document when necessary. The cool thing about Cocoon is its support for truly dynamic content generation using producers and processors. The latest version of Cocoon 2 has a lot more to offer both in terms of interoperability and performance( such as use of DOM instead of SAX ).
If you are really into it, I suggest that you checkout the
Cocoon 2 tutorial on IBM's DeveloperWorks website. Also expect a lot more Cocoon titles to hit the bookshelves in the next six months.
Cheers!