X-rays are created through a process called Brehmsstralung. It involves bombarding elements with electrons. When an energetic electron hits an atom, sometimes it ejects one of the electrons orbiting the lower orbitals of the atom. An electron from a higher orbital, which is more energetic than those in lower orbitals, moves down to fill the empty spot, shedding its extra energy in the form of a photon, which is the X-ray. An X-ray is defined as electromagnetic radiation of wavelength 0.01 to 10 nanometers. Most elements are capable of this process. A X-ray medical procedure uses millions of these X-rays to produce an image. An X-ray gun is fired at a person and the X-rays pass through most of the body, hitting a screen to make an image. Bone is more dense and shows up in the image because the X-rays do not pass through it. X-rays that do pass through the body strike a screen and light it up. The images that you see are negatives.
Tungsten
Tungsten is the element most commonly used to make X-rays. When an element is bombarded by electrons, most of the electrons do not create X-rays; they add kinetic energy in the form of heat. Tungsten has a very high melting point, which makes it more durable and useful for creating X-rays. If an element can't withstand the energy of the electron beam without failing, it is not a good element to use for X-ray creation.
Other Elements
Elements with atomic numbers 20 to 84 are capable of creating X-rays, with 36, 43 and 61 as the three exceptions. Also elements 90 and 92 are capable. All of these elements are capable of producing X-rays, because they have the right combination of necessary orbitals, abundance and physical durability.
Why
The elements with atomic numbers 1 to 19 are incapable of creating X-rays. They do not have enough orbitals for the emission of a particle of that energy. This means that most elements that have atomic numbers higher than 20 are capable of creating X-rays, but some, such as number 43 Technetium, are too scarce or are otherwise unsuitable.