The usual x-ray generation process is to produce electrons, accelerate them through a voltage - say 50,000 volts.
Then each electron will have 50 keV of energy when it hits the target where the x-rays are generated.
The target is usually a metal, but need not be. The high energy electrons knock out inner-orbital electrons from the material ... these will strike other atoms, etc ... with an inner orbital electron missing, there will be a series of electron transitions from the outer orbitals, each falling to a vacant inner orbital - and for each transition there is a "characteristic x-ray" generated which has the energy corresponding to the difference of the two levels.
See
http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/xrayc.html
So for a given target there will be a small set of characteristic x-rays of the highest energy, and that energy will _always_ be less than the energy of the electrons striking the target. There will also be a bunch of "braking radiation" x-rays, but the lower energy ones can be filtered out.
So the most efficient voltage for x-ray generation depends upon the target material. A silver (Ag) target can generate 22 keV x-rays if the incoming electrons are it bit more energetic than that ... say 25 keV. If the energy is much higher you will still get braking radiation, but you won't get any more of the 22 keV x-rays.
If you want to filter out the lower energy x-rays you can put in an extra layer of a lower-energy material. If you filter with palladium (Pd) you will intercept most of the x-rays less than 21 keV.
The details now depend upon the electron fluence (number of electrons per unit area per second) and the thickness of the target material. This is where your optimization will occur.