Xylophagy is a term used in ecology to describe the habits of an herbivorous animal whose diet consists primarily (often solely) of wood. The word derives from Greek ξυλοφάγος (xulophagos) "eating wood", from ξύλον (xulon) "wood" + φάγειν (phagein) "to eat" and it was an ancient Greek name for a kind of a worm.
Many xylophagous insects have symbiotic protozoa and/or bacteria in their digestive system which assist in the breakdown of cellulose, others (e.g., the termite family Termitidae) possess their own cellulase. Others, especially among the groups feeding on decaying wood, apparently derive much of their nutrition from the digestion of various fungi that are growing amidst the wood fibers. Such insects often carry the spores of the fungi in special structures on their bodies (called "mycangia"), and infect the host tree themselves when they are laying their eggs.