i had a load of stuff typed out here (as usual) but i can cut it dwn to this:
the XM177 (and XM177E1 and E2) are th test versions of the CAR15, the carbine version of the AR15, with became the XM16 test gun and then became teh M16 when officially adopted for use
all round teh XM177 was a better made gun, fixing a few problems th M16 had when adopted and giving more flexability etc to th overall design, as such it was grabbed by SF and senior NCOs before it was even en in full production, the X designation denotes 'Xperimental' in Army terms, ie the test prototype version of the commercially produced gun, the X is dropped and (often) a new number is then added when it's adopted officially by the army, in teh case of teh XM177 many were kept in th field as they worked so well
shorter post than it was as i googled up
this page for more info, no need to type it all out her eetc