What kind of epoxy do you have?
There are basically two kinds of epoxy. The first comes in a clay like stick that has an inner core that is a different color that the outer layer. This stuff is great to use for mounting frags in the tank and most epoxies of this type have a working time of about 10-20 minutes before it gets becomes hard and is no longer able to be molded. Just break off a piece and mix with your fingers until it is uniform in color.
The second type of epoxy is a gel type that comes in a big syringe like applicator where the two different types of gel meet and become one when you squeeze it out. I have never tried this stuff before because I have yet to find some that says on the package that it is suitable for potable water. I have heard of others using it before with no problems.
So to answer your question...Generally if I can take the item to be glued out of the tank then I will use superglue to make the bond. If not then I use the epoxy. If you have a shroom that is attached to some rubble then just use some superglue to glue the rubble to a larger rock. Shrooms are extremely hardy and will most likely not be bothered by any epoxy. If you have some loose zoanthid polyps then use some superglue on the foot of the zoanthid and glue it to some rubble. Just make sure that you do not get any glue on the head or mouth of the polyp. It will likely die if you do. Tweezers will make this job easier.
Another thing to remember when using the clay like epoxy is that large amounts of it will make your skimmer go crazy so be sure to keep an eye on your skimmer for 24 hours after using the epoxy and turn it down if necessary.
Hope this helps!