added XML functions for save protocol

Still need actual save function though low-level functions have been
added.