public void ToFile(Primitive prim, string exportFile) { if (UseBinarySerialization) { SaveToDisk(exportFile, prim); return; } OSDMap primOSD = (OSDMap)prim.GetOSD(); AddExportUser(primOSD["CreatorID"]); AddExportGroup(primOSD["GroupID"]); AddExportUser(primOSD["OwnerID"]); AddExportUser(primOSD["LastOwnerID"]); string output = OSDParser.SerializeLLSDXmlString(primOSD); { lock (fileWriterLock) File.WriteAllText(exportFile, output); } }