  We consider the quantum XX-model in the presence of competing
nearest-neighbour and global-range interactions, which is equivalent to a
Bose-Hubbard model with cavity mediated global range interactions in the hard
core boson limit. Using fermionic techniques the problem is solved exactly in
one dimension in the thermodynamic limit. The ground state phase diagram
consists of two ordered phases: ferromagnetic (F) and antiferromagnetic (AF),
as well as an XY-phase having quasi-long-range order. We have also studied
quantum relaxation after sudden quenches. Quenching from the AF phase to the XY
region remanent AF order is observed below a dynamical transition line. In the
opposite quench, from the XY region to the AF-phase beyond a static
metastability line AF order arises on top of remanent XY quasi-long-range
order, which corresponds to dynamically generated supersolid state in the
equivalent Bose-Hubbard model with hard-core bosons.
