The getDocByIdAsXml() method allows us to download a document as either as a text string or as a parsed XML object.
It would be useful to generalise this as getDocById(), with an argument switch allowing the user to select xml | json and the bParse flag, when set, returning the etree XML object or a Python dict correspondingly.