Reconstruction of Energy Distributions in Electron Beams on the Basis of Bremsstrahlung X-Ray Spectra