I also have ducts running in some of the rim joists. I used fiberglass in those. The rest I used XPS.
The XPS that I am using have tongue/groove. I don't find them particularly useful as they don't always line up. Probably it is because my basement has concrete blocks and they are not perfectly flat. I am using tape on the joints anyway.
Check if your town requires fire blocking. If so, I would suggest doing that first after you seal all the rim joists.