Testing began in 2002 and was supposed to be issued in 2005, but was recalled for more testing.The XM8's origins begin back in 2004, after the decision to discontinue the XM29 weapon system program, but continue developing it with the OICW Increment programs. The XM8 was designed for OICW Increment One, in which a stand-alone assault rifle would be developed to later be combined with the 20mm grenade launcher of OICW Increment Two. The Army's goal for the XM8 was for a weapon that was cheaper, lighter, easier to maintain, and more effective than the M16 and M4 series of weapons.
Although cancelled indefinitely, The XM8 was a participant in a limited competition against the FN SCAR-L, HK416, and the M4. During the tests, most notably of which was a reliability test in dusty conditions, the XM8 did exceedingly well. However, the results have been ruled invalid because the M4 suffered a difference of 575 malfunctions from an identical test conducted a few months before, indicating the test conditions could not be reproduced. 
Despite not being adopted by the U.S. military, Heckler & Koch decided to market the rifle globally. At some point, Malaysia expressed interest, and by 2007 they stated their interest in buying the prototypes. By 2010, the Royal Malaysian Navy special forces known as PASKAL began using the XM8 Prototypes along with other Heckler & Koch assault rifles including the HK416 and G36.
Also, a private development has been carried out by a private custom works designer , known as Tommy, who owns Tommy Built Tactical. He developed a conversion kit that turn the sl-8 semi-automatic sporting rifle into a XM-8 look alike. Production of the XM-8 kit started around 2013, and it continues today; hundreds of SL-8 rifles have been converted into various versions of the XM-8 rifle, including a shorter version based on the mini-carbine. Recently, Tommy Build Tactical is working on a construction of a new receiver body for the XM-8 conversion. It is still on an experimental stage; a nylon prototype was made, and it will be followed by an aluminum version. It's purpose will be to construct real rifle bodies, so the main components of the SL-8 rifles will be switch over the new units, without the need to convert the base rifle.
A major innovation is the new mounting system, called Picatinny Combat Attachment Points or PCAP. The idea of this system is to allow someone to remove an attachment to their weapon, like optics or an IR device, and as long as the attachment wasn't sighted in for another weapon, it could be reattached to the rifle and ready for use, no re-sighting needed. The PCAP mounting system can also be retrofitted with the standard picatinny rail mounting system that has become commonplace on nearly every weapon, military and civilian alike.