Having been through an engine swap the only swap that is effortless is like for like that means if your engine is a relic as mine was even another Yanmar comes with major work. If you have to go from one series of Yanmar to another ie YS? GM? to YM there is going to be major work. So if you can find a Volvo that lines up right it won't be a bigger deal.
Of course a good rebuilt of the same engine you have if you weren't unhappy with its output isn't a big issue and can make sense.