I'm not 100% sure of your question, but I think this is what you're after...
First, you have to parse the XML from your server. You can do this with the built in NSXMLParser
or with one of the various XML-parsers and document handlers out there. A few alternatives:
Then, you can create directories on your iPhone applications own document folder using the following code. I will assume you have a NSArray
named directories containing some directory names as NSStrings.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentPath = [paths objectAtIndex:0];
for (NSString *directory in directories) {
NSString *directoryPath = [storagePath stringByAppendingPathComponent:directory];
[[NSFileManager defaultManager] createDirectoryAtPath: directoryPath attributes:nil];
}
This code is of course very simple and does not include support for adding a entire folder structure (just the first level). But you get the idea.