The content of Mn in the semimagnetic semiconductors Cd1-xMnxTe and Sn1-xMnxTe bulk crystals and epitaxially grown layers was examined by X-ray spectrometry. The content of Mn in the investigated crystals and the homogeneity of samples were determined using electron probe microanalysis (EPMA). Bulk crystals and epitaxial layers were found to be homogeneous. In spite of this, the shapes of the Mn L alpha valence band line from a bulk crystal and a layer with the same high content of Mn were found to be very different. In this case, the content of Mn estimated from EPMA also differed significantly from that estimated from magnetic measurements. The detailed analysis of Mn L alpha lines and X-ray diffraction revealed the existence of a second MnTe phase in the epitaxial layer. The best match to the experimental Mn L alpha line was given by Spectral fitting with about 50% of Mn atoms bonded in a binary compound and 50% in a ternary compound. Therefore, in the case of epitaxially grown layers, where the different phases can be homogeneously distributed in the sample, the analysis of the valence lineshape can help to identify the existence of different compounds.