Integrated AIN nanocaps are used to protect gallium nitride epilayers during high temperature annealing treatments following high-energy implantation of rare earth (RE) ions. Cracks formed in thicker caps due to the lattice mismatch between AlN and GaN lead to the creation of microscopic surface defects at annealing temperatures higher than around 1200°C. GaN dissociates locally to produce holes in the caps. Simultaneous cathodoluminescence/ wavelength dispersive X-ray microanalysis in a modified electron probe microanalyzer allows study of the compositional and light emission variations near these microscopic defects. The intensity of the 5D0 - 7F2 transition related emission is enhanced and spectral changes can be observed, which indicate changes in the structure and/or composition of a very thin layer that forms the walls of holes in the caps. We also report some preliminary observations on the influence of the annealing atmosphere (nitrogen or ammonia) on cap damage.