From the command line type:
sudo /Developer/Library/uninstall-devtools -mode=all
You’ll need your password to use a sudo command.
The process will take a bit as it analyzes packages on your machine. Be patient and it will find and remove all Xcode and iPhone SDK components. If you’re planning on installing another version of the SDK and Xcode, you should reboot after doing so.
Thanks