'Render the template using the `context_dict` dict.
Returns an `etree` XML element.'

def render_to_xml(self, context_dict):

    context_dict.setdefault('STATIC_URL', '/dummy-static/')
    try:
        xml_str = capa_render_template(self.TEMPLATE_NAME, context_dict)
    except:
        raise TemplateError(exceptions.text_error_template().render())
    try:
        xml = etree.fromstring((('<test>' + xml_str) + '</test>'))
    except Exception as exc:
        raise TemplateError("Could    not    parse    XML    from    '{0}':    {1}".format(xml_str, str(exc)))
    else:
        return xml
