An IDML file is an XML format (InDesign Markup Language) and the files in it describe the InDesign file it came from. You can use it to make your InDesign CS5 files backward compatible. This is what happens when you export to the IDML format:
When you export a document as IDML, InDesign creates a Zip archive containing multiple XML files.
The InDesign document is split into separate files representing different aspects of an InDesign document so that you can more easily identify and perform operations on the objects and properties you need. Document resources, spreads (page geometries), and stories are stored in different XML files within the zipped package.
INX, the previous backward compatibility solution, still exists and can be used in older versions of InDesign, but IDML is what you should use moving forward.
By the way, is anyone still using InDesign CS2 out there?