 <p>There is still a good reason for a template system to use, however not Smarty, but <a href="http://phptal.org/" rel="nofollow noreferrer">PHPTAL</a>. PHPTAL templates are valid XML (and hence XHTML) files. You can farther use dummy content in PHPTAL and so get valid XHTML file with the final appearance, that can be processed and tested with standard tools. Here is a small example:</p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;First Name&lt;/th&gt; &lt;th&gt;Last Name&lt;/th&gt; &lt;th&gt;Age&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr tal:repeat="users user"&gt; &lt;td tal:content="user/first_name"&gt;Max&lt;/td&gt; &lt;td tal:content="user/last_name"&gt;Mustermann&lt;/td&gt; &lt;td tal:content="user/age"&gt;29&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>PHPTAL template engine will automatically insert all values from users array and replace our dummy values. Nevertheless, the table is already valid XHTML that can be displayed in a browser of your choice.</p>