The rtXmlMem2ExiMem and rtXmlFile2ExiStream functions can be used to convert an XML document that is either in memory or in a file to EXI format.
rtXmlMem2ExiMem translates an XML document that is in memory to an EXI document in a different memory buffer. A typical use would be to use it after encoding an XML instance with XBinder. A call to this function is added to a generated writer.c file when -genWriter and -exicompress are specified on the XBinder command-line or through the GUI.
rtXmlFile2ExiStream translates an XML instance from a file to an output stream. The output stream can be any of the stream types that can be created with the rtxStreamCreateWriter functions - typically memory, file or socket. This function is used in the xml2exi utility program that is included in the utilites subdirectory of XBinder. This utility program can be used to convert any well-formed instance into EXI format.
In addition to these functions, SAX handler callback functions are available which may be used with a standard XML SAX parser to convert XML to EXI. These are defiend in the rtXML2EXISAX.h header file.