Nanoflares and the solar X-ray corona