to get the shadow layer:
Turn on the render layers in your render globals. Make a new render layer and make sure that your ground plane is in it. Now turn off all of the other options in render globals apart from shadow. You will now just have the shadow pass of that layer.
Alan
Technical Director - Framestore
Currently working on: Your Highness
IMDB