Could iCloud be replaced by a personal WebDAV server? I like to run all my own data services (for security and confidentiality).
I'm wondering whether anyone has tried to replace iCloud with a personal server.

I presume that a combination of server side WebDAV plus jabber might do the trick together with some client side scripting and sculpting of the hosts file.

The aim would be to as completely as possible replace Apple's services but still use the OS X and iOS integration for documents and messages between a single user's devices.
Simple answer: No

More exact answer: Maybe.
You would need to have a inside knowledge of the internal processes of the iCloud. The iCloud is not just one server, but many of them with different parts (Key Value Storage, Document storage, ....)
I don't think it's possible to replace them without extreme inside knowledge.

For more info about what exactly the iCloud is (much more than just a file server) you could read this Mountain Lion Review from John Siracusa

Of course there are other services which provide the same tools for managing reminders, todos, ... But there isn't a direct replacement for the iCloud and I can't imagine that there will ever be one. That would fundamentally contradict with apples philosophy of a closed and controlled environment.