The R4041 has a Mitsubishi tier 4 interim engine, the XR4040 has a tier 4 Shibaura engine.
XR is the newer series tractor and probably has a few more options.
Both engines are very good. The XR has more emission controls than the R series but they are fully automatic and don't require user input.
I've had the XR3037HC model for over a year now and it's been a great tractor. Can't help with pricing as most all brands of tractors had a price increase since I bought mine. You check out the specs for both on the LStractor site.
XR has a few things moved around, like the loader joystick (more integrated), parking brake lever, fuel tank (behind the seat on the R, under the drivers side platform on the XR), decals & grill/headlight changes, little stuff like that.
Like mentioned, different engine with tighter emissions, slightly lower power ratings.
Biggest change is that the XR now comes with a cab option, which wasn't available in the R series.