Discussion and considerations
Firstly, it is worth looking at some of the conflicting points of view that are frequently aired in any discussion of how software should handle output for display in a browser. There is no solution that will satisfy everybody, but it is worth understanding the various demands. The best known design model is MVC; almost everybody believes that it is a good thing, although precisely how it should be implemented still remains open to debate.
For a CMS, there is a need to build some specific combination of XHTML and CSS. Taking account of the current design thinking, it is safe to assume that the XHTML should be written "semantically" in such a way as to point up the meaning of what is being displayed. CSS is left to deal with details of layout and styling. Combining them in an overall framework that can be used on multiple CMS pages, we have what is often called a theme.
There are various ways to handle XHTML in PHP, and one particular approach is advocated later...