  We present a simple algorithm to obtain solutions that generalize the
Israel--Wilson--Perj\'es class for the low-energy limit of heterotic string
theory toroidally compactified from D=d+3 to three dimensions. A remarkable map
existing between the Einstein--Maxwell (EM) theory and the theory under
consideration allows us to solve directly the equations of motion making use of
the matrix Ernst potentials connected with the coset matrix of heterotic string
theory. For the particular case d=1 (if we put n=6, the resulting theory can be
considered as the bosonic part of the action of D=4, N=4 supergravity) we
obtain explicitly a dyonic solution in terms of one real 2\times 2--matrix
harmonic function and 2n real constants (n being the number of Abelian vector
fields). By studying the asymptotic behaviour of the field configurations we
define the charges of the system. They satisfy the
Bogomol'nyi--Prasad--Sommmerfeld (BPS) bound.
