Geant4 code for XAMS simulations