X-ray production whenever electrons of high energy strike a heavy metal target, like tungsten or copper. When electrons hit this material, some of the electrons will approach the nucleus of the metal atoms where they are deflected because of there opposite charges (electrons are negative and the nucleus is positive, so the electrons are attracted to the nucleus). This deflection causes the energy of the electron to decrease, and this decrease in energy then results in forming an x-ray.
Another one:
You can also get some X-ray production via field emission, whereby electrons escape a cold metal due to very high local electric fields (the Schottky effect).