NSData *data = // get NSData from somewhere, like NSFileManager
if (data) {
myRootObject = [NSPropertyListSerialization
propertyListFromData: data
mutabilityOption: NSPropertyListMutableContainers
format: nil
errorDescription: nil];
}
For the mutability options of the resulting object, you can also use NSPropertyListImmutable and NSPropertyListMutableContainersAndLeavesNSDictionary, NSArray,NSNumber, NSString, NSData) as XML like this:
NSData *data;
data = [NSPropertyListSerialization
dataFromPropertyList: notes
format: NSPropertyListXMLFormat_v1_0
errorDescription: nil];
Then write out the data using NSFileManager, or whatever other mechanism you wish.