We present an approach that allows performing computations related to the Baker-Campbell-Haussdorff (BCH) formula and its generalizations in an arbitrary Hall basis, using labeled rooted trees. In particular, we provide explicit formulas (given in terms of the structure of certain labeled rooted trees) of the continuous BCH formula. We develop a rewriting algorithm (based on labeled rooted trees) in the dual Poincare-Birkhoff-Witt (PBW) basis associated to an arbitrary Hall set, that allows handling Lie series, exponentials of Lie series, and related series written in the PBW basis. At the end of the paper we show that our approach is actually based on an explicit description of an epimorphism ν of Hopf algebras from the commutative Hopf algebra of labeled rooted trees to the shuffle Hopf algebra and its kernel ker ν.