In the pupal stage insect larvae are virtutally immovable and defenseless. Many species therefore make, before construct a protective cocoon before they undergo the moult that leads to the pupa or puparium. Some leaf miners too sometimes make a cocoon; not alwys within the mine, but when this happens it is a valuable additional discriminating character.
Some weevil larvae excrete through the anus a whitish secretion, that is produced by the gut epithelum. This secretion is smeared all over the ; it then dries and hardens, and turns brown (Scherf, 1964a). The final product is a dark brown opaque globule in the mine, containing the pupa.
Orchestes fagi on Beach: cocoon
Within the leafmining sawflies the genus Heterarthrus stands apart because their larvae form a disk-shaped cocoon within the mine. In all other sawfly species the larvae quit the mine before pupation.
Heterarthrus vagans on Alder: cocoon
The larvae of this genus also construct a discoid cocoon, made out of silk. Unusually, thet make the cocoon long before pupation is at hand. During feeding pauses the larvae retreats to its cocoon, and is easily seen in transparancty, bent over in the shape a horseshoe.
Tischeria ekebladella on Oak: pupa in openend cocoon
Phyllonorycter larvae , whithin their tentiform mine, always make a silken cocoon, although the silk sometimes is spun so loosely that the cocoon is practically invisible. Some species make the cocoon contiguous with the inner wall of the mine, and then too the cocoon seems to be missing. But in other species the cocoon may be tightly woven, and can be quite tough to open. The colour ranges from white over gold to army green. The cocoon may be attachted to the roof of the mine, to the floor, or to both. Some species cover the cocoon with frass; sometimes only at the sides (in transparancy one then sees a dark U), sometimes the whole surface is covered bt all frass that the mine contained, giving to cocoon the appearance of a burnt croquette. How the larva manages to collect and stick all frass to the outside of a cocoon, while sealing itself inside, is a mystery.
Phyllonorycter quercifoliella on Oak: cocoon