def getAttributeDictionaryString(attributeDictionary):
 attributeDictionaryString = ''
 attributeDictionaryKeys = attributeDictionary.keys()
 attributeDictionaryKeys.sort(compareAttributeKeyAscending)
 for attributeDictionaryKey in attributeDictionaryKeys:
  valueString = str(attributeDictionary[attributeDictionaryKey])
  if ('"' in valueString):
   attributeDictionaryString += (" %s='%s'" % (attributeDictionaryKey, valueString))
  else:
   attributeDictionaryString += (' %s="%s"' % (attributeDictionaryKey, valueString))
 return attributeDictionaryString

def getAttributeDictionaryString ( attributeDictionary ) : attributeDictionaryString = '' attributeDictionaryKeys = attributeDictionary . keys ( ) attributeDictionaryKeys . sort ( compareAttributeKeyAscending ) for attributeDictionaryKey in attributeDictionaryKeys : valueString = str ( attributeDictionary [ attributeDictionaryKey ] ) if ( '"' in valueString ) : attributeDictionaryString += ( " %s='%s'" % ( attributeDictionaryKey , valueString ) ) else : attributeDictionaryString += ( ' %s="%s"' % ( attributeDictionaryKey , valueString ) ) return attributeDictionaryString
add the closed xml tag .