def WriteXML(self, file):
    if not self.loc:
      return
    out = SITEURL_XML_PREFIX

    for attribute in self.__slots__:
      value = getattr(self, attribute)
      if value:
        if type(value) == types.UnicodeType:
          value = encoder.NarrowText(value, None)
        elif type(value) != types.StringType:
          value = str(value)
        value = xml.sax.saxutils.escape(value)
        out = out + ('  <%s>%s</%s>\n' % (attribute, value, attribute))
    
    out = out + SITEURL_XML_SUFFIX
    file.write(out)
  #end def WriteXML
#end class URL
Given an instance of a serializer field, return a dictionary
dataset/ETHPy150Open benoitc/restkit/doc/sitemap_gen.py/URL.WriteXML--crossover with--dataset/ETHPy150Open tomchristie/django-rest-framework/rest_framework/metadata.py/SimpleMetadata.get_field_info