Copied and improved from https://launchpad.net/django-xmlrpc