Great, thank you very much. I hope so this feature really useful. It allow to simple export/import XML doc in different encodings, JSONs and can be enhanced future via options. The nice feature (but not for this release) can be additional cast info for import -- like "COPY table(jsonb_column) FROM stdin (FORMAT RAW, CAST json_2_jsonb). Because there are the options, there are big space for other enhancing.
Andres Karlsson pointed out that this patch has two CF entries: