Pr response format

To avoid having to handle JSON or XML response format according to document version, I added a xml2json conversion in request method, called only if JSON parsing fails.

This solved for me all problems I see in #29 discussion, although this may not be the best workaround...