The fragmentation of b quarks into B mesons is studied with four million hadronic Z decays collected by the ALEPH experiment during the years 1991-1995. A semi-exclusive reconstruction of B --> lvD((*)) decays is performed, by combining lepton candidates with fully reconstructed D((*)) mesons while the neutrino energy is estimated from the missing energy of the event. The mean value of x(B)(wd), the energy of the weakly-decaying B meson normalised to the beam energy, is found to be (x(B)(wd)) = 0.716 +/- 0.006 (stat) +/- 0.006 (syst), using a model-independent method; the corresponding value for the energy of the leading B meson is (x(B)(L)) = 0.736 +/- 0.006 (stat) +/- 0.006 (syst). The reconstructed spectra are compared with different fragmentation models. (C) 2001 Published by Elsevier Science B.V.