X-Ray Emission from Middle-aged Pulsars