Reminds me of ruby's builder (this blog has a simple, quick example:
<a href="http://beust.com/weblog/archives/000025.html" rel="nofollow">http://beust.com/weblog/archives/000025.html</a><p>Implementation of the xml builder.
<a href="http://snippets.dzone.com/posts/show/2528" rel="nofollow">http://snippets.dzone.com/posts/show/2528</a><p>This is supposedly quicker than
<a href="http://builder.rubyforge.org/" rel="nofollow">http://builder.rubyforge.org/</a><p>I imagine there is a python equivalient.