handle XML and bin files correctly