function parseCorsXml(xml, log, cb) {
    parseString(xml, (err, result) => {
        if (err) {
            log.trace('xml parsing failed', {
                error: err,
                method: 'parseCorsXml',
            });
            log.debug('invalid xml', { xml });
            return cb(errors.MalformedXML);
        }

        if (!result || !result.CORSConfiguration ||
            !result.CORSConfiguration.CORSRule ||
            !Array.isArray(result.CORSConfiguration.CORSRule)) {
            const errMsg = 'Invalid cors configuration xml';
            return cb(errorInstances.MalformedXML.customizeDescription(errMsg));
        }

        const validationRes =
            _validateCorsXml(result.CORSConfiguration.CORSRule);
        if (validationRes instanceof Error) {
            log.debug('xml validation failed', {
                error: validationRes,
                method: '_validateCorsXml',
                xml,
            });
            return cb(validationRes);
        }
        // if no error, validation returns cors object
        return cb(null, validationRes);
    });
}
parseCorsXml - Parse and validate xml body, returning cors object on success
@param {string} xml - xml body to parse and validate
@param {object} log - Werelogs logger
@param {function} cb - callback to server
@return {undefined} - calls callback with cors object on success, error on
  failure