Obtaining attosecond X-ray pulses using a self-amplified spontaneous emission free electron laser