def output_xml(data, code, headers=None):
 resp = make_response(dumps({'response': data}), code)
 resp.headers.extend((headers or {}))
 return resp

def output_xml ( data , code , headers = None ) : resp = make_response ( dumps ( { 'response' : data } ) , code ) resp . headers . extend ( ( headers or { } ) ) return resp
makes a flask response with a xml encoded body .