Several developers have helped recently to make the cocoa xmpp framework compatible with the iPhone. And I'm happy to announce that the changes have been committed, and the framework is now iPhone ready.
Cocoa XMPP Framework Google Code Page
The xcode project in subversion is still a standard desktop project though. You can get a skeleton iPhone project from here.
Apparently the iPhone SDK doesn't include the NSXML classes (NSXMLNode, NSXMLElement, NSXMLDocument). This means the framework compiles fine for the simulator, but not for the actual phone.
I originally thought I might be able to use TouchXML to solve the problem, but this is only for reading XML. There wasn't any support for creating XML, and the XMPP framework does a lot of that. Plus anybody using the framework will heavily depend on the ability to create XML. So I bit the bullet and created a set of NSXML replacement classes for the iPhone with full read AND WRITE support.
I've received confirmation that the latest changes to the XMPP framework are working on iPhone OS 2.1 and 2.2.