def dict2xform(jsform, form_id):
    dd = {'form_id': form_id}
    xml_head = u"<?xml version='1.0' ?>\n<%(form_id)s id='%(form_id)s'>\n" % dd
    xml_tail = dd % u"\n</%(form_id)s>"

    return xml_head + dict2xml(jsform) + xml_tail
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/utils/logger_tools.py/dict2xform/swapped operands of `%`