The detection of pulsed X-ray emission from a nearby radio pulsar