Excitonic processes in II–VI compounds doped with transition metal and rare earth impurities