def json_node_to_xml(xml_node, json_node):
    doc = xml_node.ownerDocument
    if(is_json_value_type(json_node)):
        xml_node.appendChild(doc.createTextNode(unicode(json_node)))
    else:
        for json_node_name, json_node_value in json_node.iteritems():
            if(json_node_name[0] == JSON_ATTR_PREFIX):
                xml_node.attributes[json_node_name[1:]] = json_node_value
            elif(json_node_name == JSON_TEXT_KEY):
                xml_node.appendChild(doc.createTextNode(json_node_value))
            else:
                tmp_xml_node = xml_node
                if(not is_list_type(json_node_value)):
                    json_node_value = [json_node_value]
                elif(Dispatcher.simple_json_lists and
                     (len(json_node_value) > 0) and
                     (json_node_name != ITEM_EL_NAME) and
                     is_json_value_type(json_node_value[0])):
                    # convert "simple" list back to default list format
                    tmp_xml_node = append_child(tmp_xml_node, json_node_name)
                    json_node_name = ITEM_EL_NAME

                for json_node_list_value in json_node_value:
                    child_node = append_child(tmp_xml_node, json_node_name)
                    json_node_to_xml(child_node, json_node_list_value)
Appends an xml node generated from the given json node to the given xml
dataset/ETHPy150Open jahlborn/appengine-rest-server/src/main/python/rest/__init__.py/json_node_to_xml