It's easy enough to generate x-rays, for better or worse, but the devil's in the details. The x-rays apparently need to be monochromatic, or nearly so, so you can't just apply HV to any old random radio tube that's lying around. And then you need a beryllium exit window on the tube and another one at the detector entrance.
Fascinating teardown on one of these things at Ben Krasnow's channel https://www.youtube.com/watch?v=KdfHVcU8U7U .