The internal structure of the solid phase formed in mixtures of the anionic surfactant sodium dodecyl sulfate (SDS) and a range of oppositely charged polyelectrolytes with different side chains and charge density has been investigated using small-angle X-ray scattering. Polyelectrolytes with short side chains [3-(2-methylpropionamido)propyl]trimethylammonium chloride, MAPTAC, and poly{[(2-propionyloxy)ethyl]trimethylammonium chloride}, PCMA) form a 2-dimensional hexagonal structure with SDS, whereas a polyelectrolyte without side chains (poly(vinlyamine), PVAm) forms a lamellar structure. The hexagonal structure of MAPTAC is retained either when a neutral monomer (acrylamide, AM) is included in the polymer backbone to reduce the charge density or when a nonionic surfactant is admixed to the SDS/polyelctrolyte complex. The unit cell length of AM-MAPTAC increases with decreasing charge density from a = 47.7 Å (MAPTAC, 100% charge density) to 58.5 Å (AM-MAPTAC, 30% charge density). The unit cell length in the lamellar SDS/PVAm complex (a = 36.1 Å) is significantly smaller than for the different hexagonal structures. It is conjectured that the cylinders in the hexagonal structure and the bilayers in the lamellar structure are based on self-assembled surfactant aggregates with the polyelectrolyte mainly located in the aqueous region adjacent to the charged surfactant headgroups