  The XGIS (X and Gamma Imaging Spectrometer) is one of the three instruments
onboard the THESEUS mission (ESA M5, currently in Phase-A). Thanks to its wide
field of view and good imaging capabilities, it will efficiently detect and
localize gamma-ray bursts and other transients in the 2-150 keV sky, and also
provide spectroscopy up to 10 MeV. Its current design has been optimized by
means of scientific simulations based on a Monte Carlo model of the instrument
coupled to a state-of-the-art description of the populations of long and short
GRBs extending to high redshifts. We describe the optimization process that led
to the current design of the XGIS, based on two identical units with partially
overlapping fields of view, and discuss the expected performance of the
instrument.
