A lateral surface grating has been prepared by holographic photolithography followed by wet chemical etching on a slightly misaligned GaAs  substrate. The structural parameters were investigated before and after thermal annealing by triple-axis high resolution x-ray diffraction (HRXRD) and scanning electron microscopy (SEM). In particular HRXRD was used to collect reciprocal space maps providing periodicity and shape of the grating. After overgrowth of the free standing nanostructure with AlxGa1-xAs the HRXRD technique fails. Only first order grating truncation rods remain in the (004) HRXRD map. They disappear completely running asymmetric reflections. On the other hand SEM at the cleavage plane reveals the perfection of the overgrowth process and the smoothness of the sample surface. Thus nondestructive analysis of the buried lateral nanostructure was performed by triple-axis x-ray grazing incidence diffraction using synchrotron radiation. This method is exclusively sensitive to the lateral strain profile and provides the possibility of depth resolution. Using two complementary in-plane reflections we found lateral strain modulation within the GaAlAs overlayer accompanied by a compositional modulation with the same period as the grating itself. This periodicity still appears close below the sample surface. © 1998 American Institute of Physics.