During the development of sourceXchange I wrote a small template parser, named Temply, which is able to handle single (closed) tags as well as nested block tags. Also, custom attributes can be assigned to tags to control their behaviour.
The parser is pretty easy to use and can be freely extended using a simple interface. The whole thing consists of just three relatively small PHP classes. It is not a full blown template engine like – for example – Smarty. It has no caching mechanisms (yet) and there are no predefined tag libs included. But I think this might as well be an advantage in some cases.
Today, I'm releasing the package in the downloads-section under the LGPL. Coding examples are included within the downloadable archive, to help you get started.