I had a problem with a Denon receiver. At times I could not get anything out of the speakers. I brought it to a service center locally. They claimed that it was the headphone jack. Even with no headphone plugged into it, it would not make the contact to trip the speaker turn on relay.
They put contact cleaner on a headphone plug and worked it in and out a few times.. also spun it around a bit. It fixed the problem. They said it was common.
So, how does this relate to your issue? Well, if the line out cuts off the headphone out... maybe doing something similar to the above could help.
If you try it, don't use so much contact cleaner that it gets through the LO jack into your X5... just enough on a plug to get a little bit into the contact area.
At this point, seeing that everything else has failed, it may be worth a try.
BTW, the contact cleaner that they used was Deoxit (the red stuff, D5 I think).
@Retrias
That actually seems to me one hell of an advice,
because normally i don't think this is how a HO dies, unless wires are cut inside,
i remember a problem on old iphones 3g where using the HO hangs, even if you remove the iem, it is still in headset mode and the speakers are not working.
Since the LO overrides the HO on the x5,
i think the problem might be with LO, even with the iem removed from LO, the device still thinks that an iem is inserted into LO.
i think you can try inserting the iem into the HO and put it in your ears, then with some other plug try inserting and removing into the LO couple of times or even cleaning it like mentioned in mandrake's post.
and if your testing this, don't forget to lower the volume, so your safe if it comes back.
i think it is worth a try !