While reviewing another patch, I noticed that the keep_comments argument
was missing a default value. To allow calling the function with only the
XML argument, I've added DEFAULT true to keep_comments.
SELECT xmlcanonicalize(xmldoc);
Updated patch (v16) attached.
Best, Jim