Here is one that should work for you. PBP3 makes it easier, once the configs are right. Just put this into your code.
It was a nice try, but it doesn't work. The crystal is not oscillating. (I looked with a scope.)
Also the PicKit2 was complaining about incorrect configuration values.
However, most of the problems are solved now, since I can change the configuration with the Epic programmer software.
One has to improvise sometimes...