Massive elliptical galaxies in X-rays: the role of late gas accretion