Yea, that ^
My friend Kris puts a cage inside her X-Pen. The cage is a "safe" place for the Bunn when he doesn't want to be bothered, and the pen gives him room to run around. Just make sure the cage is against a wall, otherwise it will be a launch-pad for him to jump out of the pen.
As others have suggested, put food, water, litter and toys where you want him to stay when you need to contain him. This makes it a "good" place to be.
I use an X-Pen across the opening to my kitchen to keep the Zoomer contained when I'm not home. I leave the gate open when I'm home, even at night (he likes to sleep in bed with me at night). He's got the whole kitchen so there's lots of room.
Even though he can free roam when I'm home, he often stays in the kitchen anyway, because that's where he has plenty of hay to free feed on all day. I also give him his breakfast of pellets and veggies there in the morning.