Formated save and load are called serializing and deserializing a text buffer. Unfortunately, there is no predefined (de)serialize functions for XML, ODT or RTF (there is an internal format called "tagset", which is able to save text and pixbufs into XML-ish format, but it's only useful if you only intend to save/load files from your application).
One problem with creating XML export is the fact that XML only holds references to images while GtkTextBuffer doesn't hold any information where source image for pixbuf came from and how it has been transformed (stretched, rotated ...). But if your data doesn't contain images, things should be pretty straight forward to implement.
See tagset serialization functions that come with gtk for inspiration: http://git.gnome.org/cgit/gtk+/tree/gtk/gtktextbufferserialize.c
Other topics related to this problem:
Hope this information helps.