Investigation of X-ray spectra of hexagonal and cubic boron nitride