You ought to be able to find a replacement XS engine easily enough if yours is no good. Why not stick with what the frame was designed for as long as you can get it.
Just about any unit-construction twin should fit, but there aren't a lot of attractive options. A 750 Triumph, Norton or Kawasaki would probably go but would gain you little in the way of horsepower. I'm scratching my head trying to think of parallel twins of 900 or 1000cc, but I come up with nothing. The bore and stroke options for the XS could be a more attractive choice.