while working on another item of the TODO list I realized that I should be using a PG_TRY() block in he xmlDocDumpFormatMemory call.
Fixed in v5.
Best regards, Jim