Gotta lotta windows open for a particular app, and want to close those you no longer need without having to go through each and close it manually? Try this trick.
Minimize to the Dock the window(s) you want to leave open. Select one of the app’s other windows and press Shift+Option (Alt)+Command+W. Alternatively, hold down Option (Alt) and click the close button in one of the windows.
This will close all the visible windows for that app, but those in the Dock will be protected. All you then have to do is maximize them. This is a very neat and simple trick, and one you should definitely integrate into your work flow.
Of course, you can clean-up a busy desktop by applying this trick to all open app windows — just minimize any windows you want to keep open, regardless of app, then select any and all windows that are still visible and perform the above trick until none are left. Then maximize the “protected” windows in the Dock.