  We present a technique for constructing equilibrium triaxial N-body haloes
with nearly arbitrary density profiles, axial ratios and spin parameters. The
method is based on the way in which structures form in hierarchical
cosmological simulations, where prolate and oblate haloes form via mergers with
low and high angular momentum, respectively. We show that major mergers between
equilibrium spherical cuspy haloes produce similarly cuspy triaxial remnants
and higher angular-momentum mergers produce systems with lower concentrations.
Triaxial haloes orbiting within deeper potentials become more spherical and
their velocity dispersion tensors more isotropic. The rate of mass loss depends
sensitively on the halo shape: a prolate halo can lose mass at a rate several
times higher than an isotropic spherical halo with the same density profile.
Subhaloes within cosmological simulations are significantly rounder than field
haloes with axial ratios that are ~ 30% larger.
