Let's say there's a perfect blackbody inside a box (at room temperature) composed of material such that only x-rays are able to enter and leave. If the absorption and emission of the x-rays weren't the same, the box would heat up above room temperature, and this would contradict thermodynamics. So, if this blackbody is being bombarded with x-rays, all the x-rays are absorbed (a perfect blackbody). Then the blackbody would emit radiation in accordance with planck's law, which suggests that the radiation would be largely in the infrared region for an object at room temperature. This radiation is not allowed to leave the material since it isn't x-rays, so the box heats up. But obviously this can't be so. The black body HAS to emit x-rays in order for it not to heat up above room temperature. So my question is, how can this blackbody emit x-rays in order to avoid heating up, when planck's law suggests that it emits radiation only in much higher wavelengths (~infrared at room temp)?