good advice above for troubleshooting the electricals.
On my XR, the kill switch on the right side was flaky. Every once in a while it wouldn't start, but if I flipped the red switch back and forth a bunch of times while cranking it would take right off. Strange thing was, it never broke competely and it never killed on me once it was running due to the switch. If you haven't already done the electrical troubleshooting you might try messing with the kill switch, it only takes a minute.