I have dealt with this in shop where I presently work. The connectors need to have the terminals tightened, for all head lights. It is a quality poor connector in my opinion.
RepairPal Certified shops can diagnose and repair your 2001 Nissan Xterra. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.