The spectrum of electro-magnetic waves is continuous, and how to divide it into different fractions under different names (ultraviolet, extreme ultraviolet, soft X-rays, hard X-rays, gamma rays, etc) is only a matter of definition.
Xrays and gamma rays are nothing but photons of different energies. X rays are emitted by atoms when electrons jump from higher to lower energy states. Gamma rays, on the other hand are emitted by nuclei. Using the equation E=hν we see that higher energy photons have higher frequencies and hence smaller wavelengths. Roughly speaking X rays have 10-8 > λ > 10-12 meters and gamma rays have 10-10 > λ > 10-14 meters. As you have noticed, these ranges do have an overlap. There is no deep physical reason for the fact that the wavelength ranges overlap. It is a matter of nomenclature.