objToStr = function (obj, format) {
        switch (format) {
        case 'xml':
            return {
                content: YSLOW.util.objToXML(obj),
                contentType: 'text/xml'
            };
        case 'plain':
            return {
                content: YSLOW.util.prettyPrintResults(obj),
                contentType: 'text/plain'
            };
        default:
            return {
                content: JSON.stringify(obj),
                contentType: 'application/json'
            };
        }
    }
Convert object to string in agiven format with appropriate mime-type.
@param {Object} obj Object to be converter into specified format.
@param {String} format The format to output string: json, xml, plain.
@return {Object} the output in the specified format
        param with appropriate mime-type.