The only way I'm aware of to do what you're asking is to run Xcode as root.
>> sudo /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Once you're running as root, anything processes launched from Xcode will also run as root. Note, though, that if you create or edit any files, they will be owned by root, which means that you'll have to chown
them before you can edit them as your normal user first.
I'd love a way for Xcode to say "Launch process as root", but as far as I know, no such functionality is available.
Note that you can also run the application within the command-line debugger gdb
to debug your application. Run
>> sudo gdb /path/to/my/application
Then you could keep Xcode open, modify at will, and debug your program within gdb. This is what I generally do.
EDIT: Readers from the future: see the answer from Alexander Stavonin; it talks about how to do this. If you're okay with ssh keys and enabling the root user on your system, his answer is the way to go.