Modern strategies for the safe handling of high level waste (HLW) and its long-term disposal in deep geological formations include the immobilization of radionuclides in the form of mineral-like matrices. The most promising matrices for the immobilization of actinides are ceramic forms of waste based on phosphate minerals such as monazite, xenotime, and cheralite. However, the mechanism of substitution of lanthanides and Y by actinides in phosphate minerals is not entirely clear. We formulated a theoretical model, compound-tunable embedding potential (CTEP), that allows one to predict properties of such crystals with point defects. The reliability of the model is validated by a good agreement of calculated geometry parameters with available experimental data. The substitution of Y in the xenotime crystal by Th and U is studied by relativistic DFT in the framework of the CTEP method, based on constructing the embedding potential as the linear combination of short-range "electron-free" spherical "tunable" pseudopotentials. It is shown on the basis of the proposed model that oxidation state +3 is energetically more profitable than +4 not only for thorium but also for uranium as solitary point defects. This atypical oxidation state of U in the mineral is discussed.