I would probably do this if check in the variable declaration section around line 23 in this file. So declare the mimeType variable in the variable declaration section as:

mimeType = mimeType ? ' mimeType="' + mimeType + '"' : '';

And then just use that variable here and line 55:

xml += '<wps:RawDataOutput mimeType="' + mimeType + '">';

becomes

xml += '<wps:RawDataOutput ' + mimeType + '>';