use this as master template.
!!!!!
i have not test this code, just be careful.
!!!!!
"""
<?xml version="1.0" encoding="utf-8"?>
<?python
from genshi.template import MarkupTemplate
the_ctxt = locals().get('__data__', None)
?>
<html xmlns="..." xmlns:py="..." xmlns:xi="...">
<head />
<body>
<py:for each="widget_template in widget_templates">
${MarkupTemplate(widget_template).generate(the_ctxt)}
</py:for>
</body>
</html>