I'm assuming you tried to use Boot Camp to install XP... did you print and read the setup guide carefully? Sounds like you formatted the wrong partition while in Windows.
The fix for this is relatively simple, assuming you didn't have anything important on that iMac. All you need to do is start up the iMac from the DVD that came with it, but before installing Mac OS X open Disk Utility and reformat the drive to a single GUID partition, so Mac OS X can use it. Install Mac OS X as normal, install any updates that are available, then set up Boot Camp.