I was out yesterday on a friends 22" sailboat when we grounded on rocks. We were healed at about 5-10 degrees dong about 4 knots when we came to an abrupt and noisy stop. We were seriously grounded on a rocky ledge about 15' from deeper water. By rocking the boat and having crew in the water pushing we were able to swing the boat around to point at the deeper water. We then tried kedging but ran into the following problem. (We also tried using our sails and swinging out on the boom to no effect.)We swam out with an anchor and 6' of chain as far as possible from the beam of the boat (not an easy feat in the wind and waves). It was easy to get the anchor set in the rocks. We then attached the anchor rode to the main halyard and proceeded to winch the line in. The problem was that that by the time we hauled in the slack of the anchor rode - the main sheet shackle was at the top of the mast preventing us from healing the boat over further. We tried taking more slack out of the anchor rode but couldn't fix the problem. We then moved the anchor closer but this put too much strain on the boats small winches and we lost our mechanical advantage or having the anchor out further.Needless to say our efforts to free our selves were futile as were our attempts to hail other boats. We eventually called 911 and were rescued by the water rescue unit of the local fire dept (a real fine group of guys). The boat and iron keel appear to be fine although it will be hauled out asap for a visual inspection.My question is does anyone have ideas on what we could have done to put the anchor out further and use the limited ability of the main halyard to get the necessary leverage to heal the boat over sufficently to free us.All in all it was a positive learning experience from many aspects.Gary