#NEWLINE# def create_resource( version = '1.0' ) : #NEWLINE# #INDENT# controller = { #NEWLINE# #INDENT# '1.0' : ControllerV10 , #NEWLINE# '1.1' : ControllerV11 , #NEWLINE# #UNINDENT# } [ version ] ( ) #NEWLINE# xml_serializer = { #NEWLINE# #INDENT# '1.0' : wsgi . XMLDictSerializer ( xmlns = wsgi . XMLNS_V10 ) , #NEWLINE# '1.1' : FlavorXMLSerializer ( ) , #NEWLINE# #UNINDENT# } [ version ] #NEWLINE# body_serializers = { #NEWLINE# #INDENT# 'application/xml' : xml_serializer , #NEWLINE# #UNINDENT# } #NEWLINE# serializer = wsgi . ResponseSerializer ( body_serializers ) #NEWLINE# return wsgi . Resource ( controller , serializer = serializer )