Measurements of RF Cavity Voltages by X-ray Spectrum Measurements