I've been using XTemplate for quite some time. Among others, I use it for localization of my applications. Particularly for applications that are mainly built up of phrases, XTemplate is a great light-weight tool for localization. Here is an example to show how I use it:
You get the picture. Now, I had some trouble with using numbers or other dynamic data in my application. For example, the phrase: 'you have 3 messages'. I had to break up this message in 2 parts: page2.php:
A placeholder is now a comma-separated list where the first entry is the main phrase and the following are vars to substitute in the main phrase, much like the format of the printf statement. I decided to keep it simple (and I was inspired my Flex, I must admit, for the {0} syntax). The following is an exerpt of the modified code of parse():