using block to initialize a XS object