Welcome to BC!
There are many possible causes, however there is one common cause. Often XP's exit sound file gets corrupt and if it does not run then XP won't shut down. I am not sure based on what you have told us so far if this is the issue or not, but let's see:
Go to:Start > Control Panel > Sounds, Speech, and Audio Devices > Sounds and Audio Devices > Sounds tab
Under Program Events
scroll down until you see Exit Windows
. Highlight Exit Windows
by clicking on it once. Then under Sounds
. Click Apply
and finally OK
Reboot if possible, or shut down computer and restart manually. Once it is up and running, shut down computer by going to Start > Turn Off Computer
. See if it will shut down on it's own now.
If it does, the only difference will be that you will not longer hear the 2 seconds of music that XP usually plays as it shuts down.