You reported you couldn't get the bulb to stay in place in the "What did you do to you X3 today?" thread, where I told you how to determine what was wrong and where you could probably get a replacement part.
Did you buy the vehicle from a dealer or private party? If it was a dealer, I would have them correct it. If it was from a private party, they must have know the headlight was messed up, did they inform you of that prior to the sale. Was a PPI performed prior to purchasing? Who inspected the vehicle prior to purchasing it? The bulb cover was even missing so that should have been a sign something was up with the headlight.