Bad XP CD, bad memory or bad optical drive. Start by testing the memory with a bootable CD such as the Ultimate Boot CD for windows which contains memory diagnostic tests.
If that proves okay, move onto the next easiest thing for you to swap out - the CD or the CD drive.