Hi brian,
Just use SerializeToBuffer api which will serialize the metadata in a buffer, once you get the buffer save it in some file. You can get the code in ModifyingXMP.cpp file. For your quick reference you can use the following code
//assumming meta is your SXMPMeta variable
string metaBuffer;
meta.SerializeToBuffer(&metaBuffer, 0, 0, "", "", 0);
ofstream outFile;
outFile.open(filename.c_str(), ios::out);
outFile << *rdf;
outFile.close();
-Sunil