objToStr = function (obj) {
        var out = 'invalid output format';

        switch (program.format) {
        case 'json':
            out = JSON.stringify(obj);
            break;
        case 'xml':
            out = util.objToXML(obj);
            break;
        case 'plain':
            out = util.prettyPrintResults(obj);
            break;
        }

        return out;
    }
Convert object to string.
@param {Object} obj Object to be converter into specified format.
@return {String} the output in the specified format param.