A method of selectively detecting the presence of at least one compound in a gaseous medium, the at least one compound comprising at least one chemical moiety selected from the group consisting of a nitro group, a nitrite group, a peroxide group, an alcohol group, an amine group and a cyano group, the method comprising:
- exposing a silicon substrate to the gaseous medium under conditions to chemically react the at least one chemical moiety with the silicon substrate and adsorb the at least one compound to the silicon substrate to form a modified substrate;
- obtaining an X-ray spectroscopic measurement of the modified substrate;
- and
- comparing the X-ray spectroscopic measurement of the modified substrate to an X-ray spectroscopic reference standard, in order to determine if the at least one compound was present in the gaseous medium.