I've been doing some photo-stacking on insects and so in earlier, been thinking of doing it for the tank also but haven't got to that yet...
What you do is as some already said, take several pictures from the same exact direction, but either shift the focus a bit, or preferably move the camera a small amount towards the subject... The technique is a lot easier if you've got at steady tripod, and a focusing rail to move the camera small increments...
You take a picture, move the camera a small amount forwards (or back), take another picture move, repeat until you've reached the end of the depth of field you want, then you use some software, photoshop works, using layers, but there are specialized software out there, like, Zerene Stacker (commercial), Helicon (commercial), CombineZP (free).
You will have to do it in a timely manner as if the polyps, etc move too much the results will suffer, you also will have to shut down the circulation in order to reduce the movement between the pictures. The combination of the pictures sometimes be time consuming in order to minimize defects like haloing (parts of a unfocused image makes a halo around the sharp image) and so on...
I was actually just yesterday thinking about writing a tutorial on photo stacking, so if there is an interest in it i may do that in a aquarium setting for you guys.