How can x-rays show how many protons are in a nucleus?
X-rays are not emitted by protons. They are emitted by atomic electrons when they fall down from an upper orbit (or level) to another one near the nucleus. Of course the electrons have first to be excited (= sent to this highly excited level). But whatever the way of exciting the electron, the energy of the transition corresponding to the return to the lowest level is proportional to the number of protons in the nucleus. If you are able to measure the energy of the emitted X-ray produced during this transition (or fall), you can calculate the number of protons of the nucleus. I am sorry. I have used a rather simple language. Pure theorists will prefer using a better vocabulary, which may not have been understood by Kantura. I may be wrong.