change logic of checking filename to reflect the addition of .xml extension