code: def as_xml(self, allow_multifile=False, basename="/tmp/sitemap.xml"):
          
          if (not self.requires_multifile()):
              return super(ListBaseWithIndex, self).as_xml()
          elif (allow_multifile):
              return self.as_xml_index(basename)
          else:
              raise ListBaseIndexError(
                  "Attempt to write single XML string for list with %d entries when max_sitemap_entries is set to %d" %
                  (len(self), self.max_sitemap_entries))
docs: Return XML serialization of this list.
  
          If this list can be serialized as a single sitemap then the
          superclass method is used.
  
          If there is no single XML serialization (in the case that the
          number of list resources is more than is allowed in a single sitemap)
          then raise an exception unless allow_multifile is set True.
          If allow_multifile is set True then will return the sitemapindex
          for the set of component sitemaps.