  A functional $E_{xc}[\rho(\r,\epsilon)]$ is presented, in which the exchange
and correlation energy of an electron gas depends on the local density of
occupied states. A simple local parametrization scheme is proposed, entirely
from first principles, based on the decomposition of the exchange-correlation
hole in scattering states of different relative energies. In its practical
Kohn-Sham-like form, the single-electron orbitals become the independent
variables, and an explicit formula for the functional derivative is obtained.
