The ubiquitous diffuse soft (1/4 keV) X-ray background was one of the earliest discoveries of X-ray astronomy. At least some of the emission may arise from charge exchange between solar wind ions and neutral atoms in the heliosphere, but no detailed models have been fit to the available data. Here we report on a new model for charge exchange in the solar wind, which when combined with a diffuse hot plasma component filling the Local Cavity provides a good fit to the only available high-resolution soft X-ray and extreme ultraviolet (EUV) spectra using plausible parameters for the solar wind. The implied hot plasma component is in pressure equilibrium with the local cloud that surrounds the solar system, creating for the first time a self-consistent picture of the local interstellar medium.