Running into "rewiring" is not uncommon but should not scare you off. There are comprehensive schematics in the "tech" section for every year XS650. When you find an "odd" colored wire in your loom, follow it back to where it is connected to a "factory" colored wire. Bear in mind that some colors have faded a bit in the half century since they were new. If this is new to you make a game of it. A bottle of whisky, brandy, rum what ever you choose. Take a shot with each new discovery. After a while you might like the game.
On the headlight plug, black is ground, green is low beam power, and yellow has two wires connected to it - one yellow in with high beam power, and one yellow out to the high beam indicator up on the dash (or in one of the instruments). Looking at a wiring diagram would tell you all this and more, but that's too easy, lol.
Beleive me 5T ... I have been weeks, looking and researching and sizzling my slightly above average I.Q.'ed brain. My Clymers dang sure don't help and whilst there are plenty of schematics here they just seem to confuse me more. Beleive me, the last thing I wanted to do was to ask the kind of question to give one of youz guyz an opportunity to make yourself look smart and me look dumb but like Popeye says "I yam whats I yam ". Hahaha. No but seriously. I rejetted my bs 34's to 135 main jet, 42.5 pilot jet. #135air jet, all jets are new except the needle jet but the needle is the slotted type put on the middle or third slot. And brand new mix screw w/new o-ring washer and spring. Put on new bars and after initial go at the HL bucket wires and scraping paint on bars for ground my e-starter came back to life! Hip hip hooray! Running and idling on her own like a champ. Haven't took her out yet though ...workin on that!
I was a lil confused that my headlight had a white, black, and yellow. I can figure out that the white was my low the black was ground, yellow high beam and indicator. It was just a few stragglers in the bucket that I didn't know about like that one lil yellow one coming off the right side main harness. And what all got plugged into the double blackie comin off the left side. And I never did find a freakin blue one except back at the tail light but I th"think" I got it all squared away now. I'm scared to go look because I already resorted to soldering !! Just a few!