InP nanowires (NWs) with differently doped segments were studied with nanoscale resolution using synchrotron based photoemission electron microscopy. We clearly resolved axially stacked n-type and undoped segments of the NWs without the need of additional processing or contacting. The lengths and relative doping levels of different NW segments as well as space charge regions were determined indicating memory effects of sulfur during growth. The surface chemistry of the nanowires was monitored simultaneously, showing that in the present case, the doping contrast was independent of the presence or absence of a native oxide.