Two essentially different materials, cubic Ti(49.8)Ni(50.2) shape memory alloy and hexagonal AZ91 Mg alloy, were deformed by equal channel angular pressing (ECAP). The microstructure developed as a result of severe plastic deformation was studied by X-ray line profile analysis. The correlation between the microstructure and the mechanical behavior was also investigated. Below 100 degrees C the tensile strength of the Mg alloy increased as a consequence of the increase of the dislocation density owing to ECAP. Above 200 degrees C the strength decreased and the ductility increased as a result of the breakage of the Al(12)Mg(17) precipitates due to ECAP. The analysis of the dislocation contrast factors of Ti(49.8)Ni(50.2) revealed that {110} dislocations with line vector formed during ECAP