The spectral evolution of impulsive solar X-ray flares