The content that you decorate doesn't need to know about the decorator which wraps it, and can in fact be any technology which produces HTML. SiteMesh was recently cleaned up as a 2.0 release, and some more work has just started.
As we've seen, SiteMesh provides for a powerful, easy-to-use, non-intrusive mechanism for applying page templates. It's easy to envision a wide range of possible uses. For example, you might define a decorator that emits extra debugging information about the page, as determined by the browser (this is especially powerful when combined with a web browser that lets you set an arbitrary user-agent). You might define a decorator with a stripped-down XML output, allowing for easier automated testing. You can even use the decorator to grab content from other pages, for example, to simple portal-like capability.
Read Will Iverson's Introduction to SiteMesh