X-ray absorption (XAS) and emission (XES) spectroscopy near B K and C K edges have been performed on metallic (ϳ0.1 at. % B, B-diamond) and semiconducting (ϳ0.03 at. % B and N, BN-diamond) doped diamond films. Both B K XAS and XES spectra show a metallic partial density of states (PDOS) with the Fermi energy of 185.3 eV, and there is no apparent boron-concentration dependence in contrast to the different electric property. In C K XAS spectrum of B-diamond, the impurity state ascribed to boron is clearly observed near the Fermi level. The Fermi energy is found to be almost same with the top of the valence band of nondoped diamond: E V = 283.9 eV. C K XAS of BN-diamond shows both the B-induced shallow level and N-induced deep and broad levels as the in-gap states, in which the shallow level is in good agreement with the activation energy ͑E a = 0.37 eV͒ estimated from the temperature dependence of the conductivity; namely, the change in C 2p PDOS of impurity-induced metallization is directly observed. The electric property of this diamond is ascribed mainly to the electronic structure of C 2p near the Fermi level. The observed XES spectra are compared with the discrete variational X␣ (DVX␣) cluster calculation. The DVX␣ result supports the strong hybridization between B 2p and C 2p observed in XAS and XES spectra, and suggests that the small amount of boron ͑ഛ0.1 at. % ͒ in diamond occupies the substitutional site rather than interstitial site.