You could use a nice big piece of polystyrene,
Carve the whole shape of the rock formation out and then aoint it in a mixture of cement and sand to give that rocky effect. You could ofcourse glue rocks to the surface of the polystyrene too.
Or if the poly is not a favourite option, use expanding foam. Line the tank with a plastic sheet/polythene bags - colour of choice for permanet fixture. Squirt some expanding foam into the bag and mould it to the shape you wish to keep. Allow it to set and then use silicone to adhere rocks,pebbles etc to the bag, using it in the same way as a pond liner.
Either way the idea is to end up with no spaces for things to escape into.