Fix invalid XML when downloading file.