  We establish a new algorithm that generates a new solution to the Einstein
field equations, with an anisotropic matter distribution, from a seed isotropic
solution. The new solution is expressed in terms of integrals of an isotropic
gravitational potential; and the integration can be completed exactly for
particular isotropic seed metrics. A good feature of our approach is that the
anisotropic solutions necessarily have an isotropic limit. We find two examples
of anisotropic solutions which generalise the isothermal sphere and the
Schwarzschild interior sphere. Both examples are expressed in closed form
involving elementary functions only.
