You install the OS's to their own partition on the hard drive.
Then you use a MBR editor, like EasyBCD, to set up the PC you ask you which OS you want to boot to.
Google: "Dual Boot Win XP and Win 7". I once found a site that was really good, but I lost it.
But why? Do you have programs that you think will not run in Windows 7. Use compatibity mode. But even I have somethings that won't, so I gave them up.