Add xml export without file creation

It would be nice to have a cimpy export functionality, which does not create a file but only the xml string/stream.

Possible API Ideas:

  1. change cim_export so that it returns the string and create a new function cim_file_export which wraps that function and writes the content into a file. This likely breaks compatibility.
  2. create a new function create_xml which creates the string. cim_export should then rely on that function.
  3. make the parameter filename of cim_export optional and return the content if no filename is given.
  4. if filename is not an string but an filehandle, write into this handle. Then one could use stuff like BytesIO to write in Memory
Edited by Jan Dinkelbach