Inserting NSXMLElement/Child at top of document

This inserts a new element and child at the very bottom of the doc within the "main" root:\[code\] NSXMLElement *root = [[xmlDoc rootElement] initWithName:@"main"]; NSXMLElement *firstElement = [[NSXMLElement alloc] initWithName:@"first"]; [root addChild:firstElement]; NSXMLElement *secondElement = [NSXMLNode elementWithName:@"second"]; [firstElement addChild:secondElement];\[/code\]I need this to be inserted up top of the doc as the first or second node.. How can I do this?Thanks.-paul.
 
Back
Top