In some cases the provided string values can contain non-printable characters. Those do not necessarily break the resulting XML but render them invalid.
It would be nice if libflexport could take care of those, since this issue isn't 100% implementation specific.