Production of charmed mesons inZ decays