Transformation of graphite into nanodiamond following extreme electronic excitations