Installing aftermarket foglights designed to fit the factory openings on the original bB can be interesting, but is reasonably easy.
First challenge is finding and purchasing the fogs (I got mine from 4carOption).
The fogs came with lamps installed and a switch with connectors to plug into the built in bB dash connector. Since the xB wiring is a bit different than the bB, a plug with wire leads allowing the switch to be connected to the xB was included.
To do the installation RIGHT one needs some extra parts: Two "mounting brackets" for the fog lights, a relay, a decent switch, about two feet of 18ga wire, and some crimp-on connectors from RadioShack.
There are three steps to the installation once all the parts are on-hand.
(1) The fog lamps come with little plastic mounting brackets that fit the bB. They are too small for the factory mounting holes and need to be replaced with the xB brackets. They are just little plastic snap-in parts, and cost less that $2 each (one needed for each fog light).
On the back of the fog light there are two plastic mounting brackets designed to just snap into factory holes in the bumper. One is on a threaded shaft, and is the aim adjuster. It works just fine on the xB. The other should be removed ans tossed - it is the wrong size for the xB.
To install the fogs, first pop the covers out of the fog light openings and find the EXISTING FACTORY WIRE AND CONNECTOR right behind the fog light openings (easiest access is to just pop the hood and reach down). The wire and connector is taped to the wiring harness. Just pull it lose.
Put one of the new xB mounting brackets into the larger (top) hole behind each fog light opening.
Plug the connector onto the 9006 bulb in the fog light, put the 'finger" sticking out of the side of the fog light into the hole in the outboard side of the opening, and push the inboard side of the fog light into the opening until the mounting brackets sort of 'snap' into place. the fogs are installed.
Now would be a good time to get your fog light switch ready. (I didn't like the one supplied, and replaced it with the usual Gardner-Bender GST45 switch that snaps right into the switch openings in the dash (pick 'em up at Loews or on line at Oznium.com. If you use the GB switch, make up two one foot long jumpers from 18 guage wire with a female 1/4 inch spade connector on one end and a male 3/16 spade connector on the other of each wire.)
(2) Next, I popped the center section out of the dash (pull A/C knobs, take out two screws, and pull the section straight out, starting at the bottom. There are three electrical connectors you must unplug before removing the plastic trim entirely). I then pulled the covered storage/ashtray/power outlet section out.
Deep in the driver's side of that opening is a wiring harness running vertically, and taped to it will be two wires in a plastic sheath feeding a three pin connector (only two are active). Cut the tape and pull the lead free. (The wires will be a black/white and a green/orange.)
Pop the blank out of one of the switch openings. Plug the 1/4 inch female spade connectors onto the back of the GB switch. Put the wires through the cubby/power outlet/ashtray switch hole you just opened up, pop the switch into the hole, and plug the two 3/16 spade connectors into the factory connector.
Tuck everything away neatly and reassemble the dash center section trim.
(3) Now comes the most difficult part (unless you are a double-jointed midget). Left and below the dash is a removable hatch through which you can access the interior fuses, relays, and ODBII connector. Vertically along the left side of that fuse block are some relay sockets FACING BACKWARDS. *sigh*
The way you are SUPPOSED to do it is to take a tiny screwdriver, put it in a slot next to the third socket down, unlock the socket mounting, pull it off, swing it around facing forward, plug in the relay, and then re-mount the socket and relay to the side of the fuse block. Isn't gonna happen. I spent three hours PROVING it isn't going to happen. I managed to unlatch the socket, but it would NOT rotate to face forward - there's another piece at the back of the fuse block keeping that from happening.
Eventually I said a few choice words not suitable for polite company and decided to see if I could plug the relay in blind with the socket facing away from me. Took me about 15 minutes before I got the relay and socket lined up, and it dropped right in. (Then I re-mounted the socket to the side of the fuse block.)
At that point, everything should work. I tentatively turned on the headlights and flipped the fog light switch on. The fogs lit up. Flick to high beam, they go off, turn headlights off, they go off. Works as designed (and as required by federal law.
There's another thread in here somewhere that has all the schematics and the actual Scion instruction manual for installing the factory fogs. I'm too lazy to find it right now for a link, and I'm even too lazy to find the documents on my server right now (that's where they have lived for years).
Later I'll probably take a pic or two, right now I'm relaxing with a nice mug of hard apple cider.
That's it for now... Excuse the tpyos - I provide them at no extra cost to increase your problem solving skills...