This seems a bit awkward, could be

    if @$('input:file').val().match /xml$/i