Common Shutdown problem on Windows XP came from background applications or Windows Service which use a lot of time to close. This Shutdown problem can also caused by hung application, antivirus still working on background scan, auto updater and can either caused by low memory and processor speed.
In worse case, computer will stay on hung position until it forced to turn of by pressing power button. In this case you can use AutoEndTask feature in Windows XP to force closing all the hung applications.
To enable this feature and make you computer shutdown faster, open regeditand go to HKEY_CURRENT_USER\Control Panel\Desktop. You need to change 3 String Value on this folder that is AutoEndTask, HungAppTimeout and WaitToKillAppTimeout. Set AutoEndTask to 1 to enable Auto Close (Auto End Task) feature, then set HungAppTimeout to 1000 and then setWaitToKillAppTimeout to 2000.
Next go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Controland set WaitToKillServiceTimeout string value to 5000. This feature will set Windows Service close time out with 5000 ms. Restart you computer, and next time you computer should shutdown more faster than before.