Can't remember the last time we had a thread go this well, all pages filled with great input and advice with no one trolling or having thick arguments.
OP I'm in the same boat as you for some time now looking for the same bike for the same purpose, just need to do some finance stuff but lazy lazy.
So far as safety goes (This is my opinion as a cager attentively observing the bikers on my daily commute + what I've seen elsewhere over time) I'd say you are in control 95% of your own safety, 5% for the unprecedented things like being rear ended or cars swerving out infront of you when other traffic is stationary etc etc.
There is a number of bikers on my commute every day (a lot of GS650's for some reason) and all of them bar the occasional hooligan ride very safely and skillfully, I've noticed they wait until traffic is nearly stationary before splitting and do so just a bit faster than traffic and never on the outside left , they pull away from the group of cars at lights and keep to the right of their lane if tailing cars switching to the left when nearing stops and ride with their lights on! high beams in the day help as well, you really struggle to see bikes in your mirror until they are relatively close, if the have their lights on it catches your eye so you become aware of them sooner.
Many other small things I notice that I must remember to do if I start riding, for the most part they seem to try and stay away from traffic, I suppose because ours is so unpredictable, will be difficult on a XR though because its got no power and even less in 5th so you can't accelerate away from traffic seeing as most people drive 100+ on anything other than a church street.
Anyway get proper gear, go for riding courses (BMW do good one's I hear on the Motorcycle Owners thread) take it slow, practice E Stops especially if you don't have ABS, do proper maintenance on you bike and get a helmet cam so you can show us all the idiots you encounter.