In this contribution we review in detail our recently developed hybrid model able to trace simultaneously nonequilibrium electron kinetics, evolution of an electronic structure, and eventually nonthermal phase transition in solids irradiated with femtosecond free-electron laser pulses. Diamond irradiated with an ultrashort intense x-ray pulse serves as an example to show how an irradiated material undergoes an ultrafast phase transition on sub-picosecond timescales. The transition of diamond into graphite is induced by an excitation of electrons from the valence band into the conduction band, which, in turn, induces a rapid change of the interatomic potential. Our theoretical model incorporates: a Monte-Carlo method for tracing high-energy electrons and K-shell holes in diamond; a temperature equation for the valence-band and low-energy conduction-band electrons; a tight binding method for calculation of the evolving electronic structure of the material and potential energy surfaces; and molecular dynamics propagating atomic trajectories. This unified approach predicts the damage threshold of diamond in a good agreement with experimentally measured values. It reveals a multi-step nature of nonthermal phase transition being an interplay between electronic excitation, changes of the band structure, and atomic reordering. An effect of pulse parameters, such as photon energy and temporal pulse shape, on the phase transition is discussed in detail.