I think these are the larvae of bee moths or wax moths. A lepidopterist might be able to tell you which, but both species have a similar life cycle. The larvae feed on the honeycombs of bee nests and make these distinctive silken tubes, often in sheds or under floorboards near to the bees' nest they have been feeding on. I've attached a fact sheet with further information,
The cocoons are certainly very alike. I forgot to mention that the cocoons had dissolved/softened the wood enough to make a hollow indentation the same shape as theirselves, and the stickiness in the wood/tubes was such that I had to pull the two pieces of pine apart. While the tubes are very similar to bee moth larvae tubes, the place I found them in doesn't seem to match. We have never had any bees' nests in our area (10 yards from a harbour, with little greenery round us) and at the moment the very small shed (cement,plastic roof) is bare bar half a dozen offcuts of wood. Has anyone any other suggestions?