We model the pulse profiles and the phase-resolved spectra of the anomalous X-ray pulsar 1E 1048.1-5937 obtained with XMM-Newton to map its surface temperature distribution during an active and a quiescent epoch. We develop and apply a model that takes into account the relevant physical and geometrical effects on the neutron star surface, magnetosphere, and spacetime. Using this model, we determine the observables at infinity as a function of pulse phase for different numbers and sizes of hot spots on the surface. We show that the pulse profiles extracted from both observations can be modeled with a single hot spot and an antipodal cool component. The size of the hot spot changes from approximate to 80 degrees in 2007, three months after the onset of a dramatic flux increase, to approximate to 30 degrees during the quiescent observation in 2011, when the pulsed fraction returned to the pre-outburst approximate to 65% level. For the 2007 observation, we also find that a model consisting of a single 0.4 keV hot spot with a magnetic field strength of 1.8 x 10(14) G accounts for the spectra obtained at three different pulse phases but underpredicts the flux at the pulse minimum, where the contribution to the emission from the cooler component is non-negligible. The inferred temperature of the spot stays approximately constant between different pulse phases, in agreement with a uniform temperature, single hot spot model. These results suggest that the emitting area grows significantly during outbursts but returns to its persistent and significantly smaller size within a timescale of a few years.