Unable to upload new file as a product

WordPress does not allow uploads of .xml files but you can add it by adding a mime type for it. This worked for me:

function addUploadXML($mimes) {
    $mimes = array_merge($mimes, array('xml' => 'text/xml'));.
    return $mimes;
}
add_filter('upload_mimes', 'addUploadXML');

Also, when I researched the mime type, I came up with a number of different suggestions for what to use as a mime type for xml. I just used ‘text/xml’ but I also saw ‘application/rss+xml’ and ‘application/xml’ among others.