Are you changing the cassette? I.e. does it matter if you destroy it in the process? Is there any way to use something like mole grips on the cogs themselves. Even though I have XD on one of my bikes, I struggle to visualize stuff like this, so I might be talking shit.
Is there any way to lever the whole thing off? Driver and all? You could then maybe use something like a vice to hold the driver body whilst twisting the cassette. Again, I’m struggling to visualize. I used to have to slightly undo Shimano cassettes before levering the whole lot off due to a super stiff pair of hope end caps once……
None of the approaches I would take would necessarily leave you with intact components.