Boot from your windows XP CD, Ignore the first prompt asking if you want to repair an installation. Wait for the installation to scan your computer, it will then tell you you have an existing XP installation and it will offer to fix it. Choose Yes, this will take around 45 mins but will replace all your windows files with working ones-
is what I do - sometimes you have to do it twice.