'Dump non-empty contents to the output file, in XML format.'

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)
