Hi ,
Firstly open the file using OpenFile api and then get the xmp metadata from an open file using GetXMP call.
You can add additional metadata using SetProperty call on the meta object .
Then call PutXMP( updates the XMP metadata in this object without writing out the file ).
The disk file is only updated once the CloseFile api is called .
e.g.
SXMPMeta xmpMeta;
SXMPFiles xmpFile;
xmpFile.OpenFile(testFile, kXMP_UnknownFile, kXMPFiles_OpenForUpdate);
xmpFile.GetXMP(&xmpMeta);
xmpMeta.SetProperty(kXMP_NS_XMP, "Rating", "2");
xmpFile.PutXMP(xmpMeta);
xmpFile.CloseFile();