Recently, I came across similar sort of case where a thinkpad won't restart, sleep or hibernate, turned out the memory was bad, replacing it solved all the issues.
With the information you provided the cause of your thinkpad's problem can lie anywhere in the software or hardware, so lets start with the software first.
Make sure your Windows XP is up to date with all the required updates from Microsoft notably SP2, also be sure latest BIOS and proper power management drivers are installed from lenovo updates.
Also take a look at following Knowledge bases from Microsoft:
Advanced troubleshooting for shutdown problems in Windows XP. (pay attention to kb 320299)
Windows XP restarts when you try to shut down your computer.
Windows XP Shut Down and Automatic Reboot Problems. (an old article)
Some additional info:
WINDOWS XP SHUTDOWN & RESTART TROUBLESHOOTING. (sic)
For hardware troubleshooting, run PC-Doctor tests in Windows and memtest86+ diagnostic test on your memory.
I also suggest you google for such shutdown problems.
In my experience most of the times, such problems are software related so if nothing helps then boot from a LiveCD of any linux distro and if all looks good then the problem would certainly be with your Windows that you can put back to factory settings by pressing blue button during boot. Please do make sure to backup your all important data beforehand.
If turns out it's a hardware issue and your thinkpad is still under warranty then IBM will honor it and fix the problem for you.