You will first need to ensure the HDD’s are the same type. There are two types, IDE and SATA. If they are IDE, you will need to ensure the jumper settings are correct. The primary HDD is typically set as Master and since it is already in use as the C drive on another PC, you shouldn’t have to change anything.
You can try simply installing it and booting up. You have a 50/50 shot of it operating. Windows will see the hardware has changed and should attempt to “fix” itself, which means it will try to load drivers for all of the new hardware (you may be prompted for your XP CD). If that fails or it won’t even boot, then you will have to do it manually. It is recommended that you do it manually anyway, that way you don’t inherit any of the garbage and bloat from the old system. You simply boot from the XP CD and choose new install. You don’t need to format, although that is also recommended as it will allow you to start from scratch with nothing present on the drive. Windows will likely have most if not all of the drivers needed for your hardware, but you will want to hit the manufacturers website for all of your installed hardware and look for new/updated drivers.