Grub installs a small part of itself to the MBR (master boot record) at the beginning of the harddrive. If only xp were installed, it would do the same with it's bootloader.
Since you can'b boot from the xp install cd, I'd guess that your BIOS isn't set to poll the cd drive before the harddrive. You need to restart the computer and edit the bios to poll the cd before booting from HDD. If I remember correctly, you press the delete key while the computer is running the POST routines. There should be a message at the bottom of the screen telling you which key to press.
Once you get the Bios configured, use the xp install disk to boot, and boot into the xp version of command line mode. Then run 'fdisk /mbr', or maybe it's 'fdisk \mbr' to restore the mbr for xp to be bootable. Then re-install Linux.
Grub boots Linux and some other Unix compatibles natively. For xp, grub used the chainloader command to pass booting from grub to xp's bootloader.
Partitions are formatted for the OS that will be installed there. There are octal (?) codes which designate OS type. I don't remember what it for xp, but Linux swap is something like 0x82 and Linux is 0x83 (or something along those lines). That's how the detection and identification is done.
To change the boot order in grub, there are two ways to do it. In the /boot/grub directory, you will have either a grub.conf or menu.lst file. That's the one used by grub to setup the menu you see when grub starts up.
There is a line: default 0. That tells grub to boot the first OS in the list ad the default (grub numbers start at 0). So, if xp is second in the list, change to default 1, and xp is now the default.
Or, just cut and paste the parts of the list to put the OS you want as default as first in the list, and leave the default 0 as is.
Then, google up a copy of the Grub Manual, and read.