Theory of X-Ray Emissions in Solar Flaring Loops