Xcode already has a single-window mode, if you don't want to work with multiple windows. You'll also want to learn about the Close All Windows command (Command+Option+W), which closes all windows of the same kind. You can use it to close all source windows, all debugger windows, etc. The same command works in most OS X apps.