I'm just guessing on a lot of this, so feel free to tell me I'm wrong if you disagree: I think it would be hard to permanently damage either a CD or a HD with X-rays. If the HD was actually operational, medium to high power X-rays could be absorbed into the semiconductor chips which make up the control electronics and could flip the internal bits of memory elements causing data loss. But the HD would have to be powered up. Powered down, I can see how low-power X-rays would do anything. At higher-power, you could change some of the structural properties of the materials. But these would have to be really high-power.
Airport x-ray machines are so low power that they have virtually no effect on film - which are, by their very nature, very sensitive to photons and x-rays. HD's and CD's are not sensitive at all to photons or X-rays - so they are far less less likely to be affected. Perhaps CD-RW's could have a relatively low threshold for X-rays, but even these wouldn't be affected by the low power levels used in airports.
Based on my knowledge, a lot of years of education in low-level physics and my background as a professional engineer, I would have to say that your teacher is wrong. I can't imagine that an airport machine could have any effect on a CD.