def METHOD_NAME(self, xmlstring):
    """
    Try to parse the file with other encodings
    """
    xml = None
    for encoding in ['ISO-8859-1', 'UTF-8']:
        self.logger.info('Trying to parse with enforced %s encoding'
                         % encoding)
        try:
            builder = EncodingSafeParser()
            builder.setEncoding(encoding)
            xml = builder.parseString(xmlstring)
            self.logger.info('String successfully parsed')
            # Exit for loop if success
            break
        except expat.ExpatError, e:
            self.logger.error('Parsing failed')
            if expat.errors.XML_ERROR_INVALID_TOKEN in str(e):
                pass
            else:
                # Unhandled error, just re-raise it
                raise e
    if xml:
        return xml
    else:
        raise Exception("Can't parse inventory XML string")