Density-functional theory (DFT) calculations yield useful ground-state energies and densities, while Green's function techniques (such as GW) are mostly used to produce spectral functions. From the Galitskii-Migdal formula, we extract the exchange correlation of DFT directly from a Green's function. This spectral representation provides an alternative to the fluctuation-dissipation theorem of DFT, identifying distinct single-particle and many-particle contributions. Results are illustrated on the uniform electron gas and the two-site Hubbard model.