Core excitons in solid rare gases: Kr-3d and Xe-4d transitions