Various mesoporous silicas and the corresponding aluminosilicates or gallosilicates have been synthesized using a series of literature or `home made' recipes. The efficiency of Al or Ga incorporation in the siliceous walls of these materials depends markedly on the trivalent source and the evolution (ageing) of the so-formed Si-MIII gel-type phases at different starting pH values and temperatures, after adding the surfactant-structuring compounds. Crystallization at low temperature (e.g. < 373 K) yielded mesoporous compounds with hexagonal topology (MCM-41 type), involving double-layered Si walls possibly partly substituted by Al or Ga. Such structures remain stable after calcination in air at 873 K. When the same gels are crystallized at 423 K for 2 d, lamellar frameworks (MCM-50 type) are preferentially stabilized. They readily collapse on heating. The ultra-small-angle X-ray scattering (USAXS) data and the first part of the SAXS data show a power behaviour that indicates a fractal interface before calcination. After calcination, in the case of MCM-50 type materials, the fractal dimension significantly increases, the fractality region being larger than in the precursor. By contrast, in the case of MCM-41 type materials, the fractal region tends to disappear after calcination. The second part of the SAXS curve reflects the hexagonal or lamellar structure. Some precursors simultaneously exhibit both structures. The hexagonal parameter ranges from 4.6 to 5.8 nm, while the thickness of the wall is estimated to be of the order of 0.7 nm from observations of the satellite peaks in the vicinity of the successive peaks characterizing the hexagonal array. The successive peaks relative to the lamellar structure are consistent with the superposition of two or three layers, the thickness of which are of the order of 3.3, 2.85 and 2.5 nm. Predominant hexagonal structures are maintained after calcination while lamellar structures collapse during calcination. In the case of hexagonal structure, the hexagonal array is slightly contracted.