However, such a separation is important for large scaled applications. For example, you might like to resuse the logic for WAP handys, for another client, but change the design. They get an HTML file as input, they produce HTML as output. There's no possibility of splitting them into pieces and reusing the pieces, other than creating a separate library. The formatter, that converts your document into HTML, WML, or whatever.
Cocoon is an integrated framework for all of the above.
The components are a producer, an arbitrary number of processors and a formatter. It receives no input. For example, a typical producer might read an XML file from the hard drive. Another producer might read an XML document from a Tamino database engine. Yet another producer might read an LDAP tree and convert this into an XML document.