About halfway down page 'Troubleshooting Windows XP Shutdown Issues' click here
"Right-click on My Computer, click Properties, click the Advanced tab. Under Startup & Recovery, click Settings. Under System Failure, uncheck the box in front of System reboot."
There are other explanations on same page for possible causes.
Have you had a look in Event Viewer > System, for any errors?