def render_genshi_tmpl(tmplstr, context, tmplpath=None):
    method = context.get('method', 'xml')
    if method == 'text' or method == 'newtext':
        from genshi.template import NewTextTemplate
        tmpl = NewTextTemplate(tmplstr)
    elif method == 'oldtext':
        from genshi.template import OldTextTemplate
        tmpl = OldTextTemplate(tmplstr)
    else:
        from genshi.template import MarkupTemplate
        tmpl = MarkupTemplate(tmplstr)

    return tmpl.generate(**context).render(method)
Render a Genshi template. A method should be passed in as part of the
dataset/ETHPy150Open saltstack/salt/salt/utils/templates.py/render_genshi_tmpl