Hernani Cerqueira has posted a quick introduction to using XSLT (an XML-based markup for styling XML documents) as a templating engine for PHP.
One thing that I miss is a good unobtrusive template engine for PHP. Of course there is smarty, and a bunch of pear packages as well as some other free or commercial projects, and Iâ€™m honest to say that Iâ€™d never tried none of these, simply because I still see XSLT as a perfectly valid and powerful solution This post is a small tutorial about using XSLT as a templating engine for PHP.
He takes some time to explain what XSLT is and why it's a good choice (from his opinion) for templating your site. A code example is included where he builds a simple XML document (with the DOMDocument functionality of PHP) and creates a XSLT style sheet to take that information and change it into a formatted HTML document. Outputting the result is easy with the creation of a new XSLTProcessor object and a push out the other side with a transformToXML method call.