Hello,
This is a doozie of a problem. The question is if you want all of the OS to be able to work files with each other... does the RH OS need to see the XP files? In XP, do you want to see debian?
I do not think a 40 GB hard drive is going to be enough to do it all, especially if you want equal installations on each environment (meaning all have open office, all have web browsers, all have compiler tools).
I know that you will need to choose one OS to manage the boot loader, and that you will need to install XP first after your partitioning is complete. If you want other OS to see XP data, you best format FAT32 and leave NTFS alone.
You are going to need to use extended partitions on the physical drive.
Before getting too deep into this, you might want to make sure you need ALL of them installed on that one physical disk. You might find it easier in terms of time cost to go and get a couple other hard drives, and then swap them in and out as needed.
And once you do set it up, you best document how you did it, and also use something like Ghost to back them all up to a network, or perhaps DVD disks.
Christian