There is no such thing as an impedance mismatch when connecting a headphone output to a line input. The only difference between a line out and a headphone out, generally, is that the headphone out can provide greater current, in order to drive headphones, which are of a much lower load impedance than a line in. Also, do not expect higher voltage output from line out as compared to a headphone out on a portable device. Unless the line out dock accessory has a built in pre-amplifier, the line out voltage will be limited to the voltage limitations of the supply rails in the portable device. Generally, this means that not even 1 VRMS is possible from such portables unless they use an interal DC->DC convertor to increase interal voltage over the battery limit; I am not immediately aware of one that has such a feature. If there are audible differences between the sound quality of the line out and headphone out of a particular device, then they are the result of poor circuit design, or defect. However, most percieved cases are probably nothing more than placebo.
-Chris