Shutdown issues are generally caused by a program and/or process that is refusing to exit gracefully. The program and/or process can be from malware or can be legitimate (such as an invasive antivirus like Norton or McAfee). If you are using a Norton or McAfee product, uninstall it and replace with a better program such as NOD32, Kasperksy, or Avast (free). The Windows Firewall is adequate for most people. Shutdown issues can also be caused by old/poorly written drivers so make sure all drivers are updated, particularly on Windows Vista and Windows 7.
If the computer is virus/malware-free, drivers are current, and no Norton or McAfee programs are installed, then do clean-boot troubleshooting to see which program/process is the culprit:
If that is too much for you, simply reinstall xp