If you want to make the hard drive from one machine a secondary drive in another machine, then all you need to do is unplug the drive from the old machine and install it in the new machine. If the drive is IDE (also called PATA) you may need to change the jumper on the drive from master to slave.
If you want to make the hard drive from the one machine the boot drive in another machine, it will probably be a bit harder. If the machines are basically the same hardware you can try to put the drive in and boot off of it. It might just work. If the hardware is different then you can still try it, Windows might be able to find all the drivers. More than likely you will need the Windows XP CD/DVD so that you can reinstall.
When you are reinstalling, select the option to install, not repair. Make sure that you leave the disk partitions alone, do NOT format them. If you format the drive you will loose all your data. After reinstalling Windows XP, you will need to reinstall all software which you use (Office, etc).