Theoretical description of time-resolved photoemission spectroscopy: application to pump-probe experiments.