Treatment of cavities by bonding