Hi, Jim
Usually XP is waiting for apps or services to shut down in an orderly fashion. Also it may be trying to close network connections which are no longer available, for example if you have a mapping on a share over the network and the share is no longer available because that server shut down first.
To see if it is an app or service which is slow to close, try terminating them manually and then shut down XP. If that cures it then you know it is one of the programs you manually terminated.
Prime candidates are desktop search engines, virus and adware scanners and MS Outlook (which should always be shut down manually anyway).
If this is something which has started happening without apparent cause, check for malware.
Jock