A couple thoughts on replacing your engine. I own a Bavaria 40 Ocean and I've owned both volvo and yanmar engines. Its usually easier to replace your engine with the same type but not impossible to switch. One thing you might take into account is your sail drive may need to also be replaced if you switch engines (I could be wrong). I did find a link that seems to be an add for a Yanmar adapter for a Volvo.
http://tinyurl.com/488abte
I've heard a lot of people complain about sail drives but so far I love mine. Hopefully I didn't curse myself. It does appear the spare parts are a little more expensive. It's a volvo MD22 50 hp. It's well maintained and the sail drive is meticulously maintained as well. Good luck in your quest.