Xyce and ngspice are both spice-like analog simulators. Both Ngspice and Xyce have options for simulating Verilog-A, ngspice has the ability to run event driven code models (Xspice).
In general you can draw a circuit schematic in Xschem that can be simulated both by Xyce and Ngspice, putting the different simulator commands in two different code blocks.
See for example
sky130_tests/test_inv.sch