Near edge x-ray absorption fine structure (NEXAFS) spectroscopy has been employed to obtain the temperature dependent evolution of the electronic structure of acid treated carbon nanotubes, which were further modified by dielectric barrier discharge plasma processing in an ammonia atmosphere. The NEXAFS studies were performed from room temperature up to 900 degrees C. The presence of oxygen and nitrogen containing functional groups was observed in C K edge, N K edge, and O K edge NEXAFS spectra of the multiwalled carbon nanotubes. The N K edge spectra revealed three types of pi(*) features, the source of which was decisively identified by their temperature dependent evolution. It was established that these features are attributed to pyridinelike, NO, and graphitelike structures, respectively. The O K edge indicated that both carbonyl (C = O), pi(*)(CO), and ether C-O-C, sigma(*)(CO), functionalities were present. Upon heating in a vacuum to 900 degrees C the pi(*)(CO) resonances disappeared while the sigma(*)(CO) resonances were still present confirming their higher thermal stability. Heating did not produce a significant change in the pi(*) feature of the C K edge spectrum indicating that the tabular structure of the nanotubes is essentially preserved following the thermal decomposition of the functional groups on the nanotube surface. (c) 2006 American Institute of Physics.