转:http://www.jabbercn.org/XEP-0138
NSXMLElement *compress = [NSXMLElement elementWithName:@"compress"];
[compress addAttributeWithName:@"xmlns" stringValue:@"http://jabber.org/protocol/compress"];
NSXMLElement *method = [NSXMLElement elementWithName:@"method"];
[method setStringValue:@"zlib"];
[compress addChild:method];
NSLog(@"%@",[compress XMLString]);
[xmppStream sendElement:compress];