Yeah, you can.
With Xp, its pretty easy becuase they will detect each other and give you a boot menu with the options to select which OS.
Installing each on a separate hard drive is best as you won't have to much about creating partition and risk losing data.
Just install each OS on a hard drive separatly and then connect both up as master slave combination. Then when you log on, you should get the boot option.