Generation and Characterization of Attosecond Pulses from an X-Ray Free-Electron Laser