def unparse(input_dict, output=None, encoding='utf-8', full_document=True, **kwargs):
 ((key, value),) = input_dict.items()
 must_return = False
 if (output is None):
  output = StringIO()
  must_return = True
 content_handler = XMLGenerator(output, encoding)
 if full_document:
  content_handler.startDocument()
 _emit(key, value, content_handler, **kwargs)
 if full_document:
  content_handler.endDocument()
 if must_return:
  value = output.getvalue()
  try:
   value = value.decode(encoding)
  except AttributeError:
   pass
  return value

def unparse ( input_dict , output = None , encoding = 'utf-8' , full_document = True , ** kwargs ) : ( ( key , value ) , ) = input_dict . items ( ) must_return = False if ( output is None ) : output = StringIO ( ) must_return = True content_handler = XMLGenerator ( output , encoding ) if full_document : content_handler . startDocument ( ) _emit ( key , value , content_handler , ** kwargs ) if full_document : content_handler . endDocument ( ) if must_return : value = output . getvalue ( ) try : value = value . decode ( encoding ) except AttributeError : pass return value
emit an xml document for the given input_dict .