A lot of people have had trouble getting onto XBL despite their Xbox Ones connecting to the net. I read a lot of ways to fix it but this is the one that worked!
1. Go to settings
2. Go to Network
3. Go to Advanced Settings
4. Go to DNS settings
5. Select Manual
6. Enter Primary DNS 18.104.22.168 and press enter
7. Enter Secondary IP 22.214.171.124 and press enter