Do you mean you are purchasing a PC with a 40 gig drive or just a 40 gig drive as you wrote? If so, are you wanting to just transfer a larger drive with XP and all software and data intact? This will affect the answer as this part gets complicated. Much depends on the software disks you already have and those that will come with a new PC. Yes, you can change the drive with one from another PC. There isn't a physical size difference unless your small footprint unit uses a notebook sized 2?" drive. Both also need to be the same interface type and I will guess IDE. A little more about your exact plans would help as such a transfer with already installed software is not plug and play.
Purchacing a 40G with XP. Want to take my current 120G with XP and use it instead. Only room for one hard drive in new small foot print computer. I have an external 160G hard drive USB2/EEE that I use for back up. Both computers have USB2 and EEE. Also have about 50G of back up used on external drive.