I have a homemade plug and play harness for my nissan terrano regulus headlights. I did not make this harness myself, but I can give you pictures so you have an idea. It was made using Nissan relays, the HID headlights get their power from the battery but power is triggered by the 9004 sockets (qx4 used 9004 sockets from 97-99... 99.5-00 use a different plug)
Everything is powered except for the auto leveling, I do not have the plugs or switch for leveling but i would love it!!
I want to upload a picture of the harness but I do not see an option to upload photos? Is this outsourced photo hosting only now?