So far, the trend seems to be for Apple to support devices for 5 years after release [0]. Most apps will support at least 1 previous version of iOS, so your total lifespan is around 6 years total. Given that, you end up with:
XR: $750 / 6 years = $125/year
8: $599 / 5 years = $120/year
7: $449 / 4 years = $112/year
So assuming you plan to keep the device for its entire lifespan, I'm not sure it actually matters very much what you buy.
[0] http://infographic.statista.com/normal/chartoftheday_5824_io...