XML-encode strings in log entries

Addresses issue reported in https://redmine.dataone.org/issues/3679