You can try removing the CD drive from Device Manager, rebooting, and letting Windows redetect the CD drive. That might fix a software problem.
If you don't know how get to Device Manager,
***this site*** has links for three different ways to do it in XP.
If letting XP redetect the CD drive doesn't help, check whether all CD's are causing the problem. It may be that your CD drive is failing.