docs: def serialize_dict(self, attr, dict_type, **kwargs):
          """Serialize a dictionary of objects.
  
          :param dict attr: Object to be serialized.
          :param str dict_type: Type of object in the dictionary.
          :param bool required: Whether the objects in the dictionary must
           not be None or empty.
          :rtype: dict
          """
          serialization_ctxt = kwargs.get("serialization_ctxt", {})
          serialized = {}
          for key, value in attr.items():
              try:
                  serialized[self.serialize_unicode(key)] = self.serialize_data(
                      value, dict_type, **kwargs)
              except ValueError:
                  serialized[self.serialize_unicode(key)] = None
  
          if 'xml' in serialization_ctxt:
              # XML serialization is more complicated
              xml_desc = serialization_ctxt['xml']
              xml_name = xml_desc['name']
  
              final_result = _create_xml_node(
                  xml_name,
                  xml_desc.get('prefix', None),
                  xml_desc.get('ns', None)
              )
              for key, value in serialized.items():
                  ET.SubElement(final_result, key).text = value
              return final_result
  
          return serialized