When some frogs hibernate/ oestivate (the jury's still out on this one) they secrete a thin slimey bag around the body, which they eat on waking- grotesque to watch but fascinating! Apparently it provides essential nutrients to the waking frog. I prefer cornflakes myself.
On second thoughts it does look more like a caterpillar than a beetle larva, and it seems to have a spike on its rear like your pic of the hawkmoth caterpillar. It could be an elephant hawkmoth caterpillar.......?