Better than doing this, either:
1) Render a jinja remplate with `render_template`, or
2) Use elementree.

If it hurts (and one hopes building XML by hand hurts), assume there's a better way.