python
from genshi.template import MarkupTemplate
template_text = """
<html>
<head><title>$title</title></head>
<body>
<h1>$header</h1>
<ul>
$for item in items:
<li>$item</li>
$end
</ul>
</body>
</html>
"""
template = MarkupTemplate(template_text)
context = {
'title': 'Genshi Demo',
'header': 'Welcome to Genshi',
'items': ['Item 1', 'Item 2', 'Item 3']
}
output = template.generate(**context).render('xhtml')
print(output)