Setting more than the default 2 spaces as an option for indents does nothing:
const builder = new xml2js.Builder({ pretty: true, indent: ' ', newline: '\n' });
Only if you change the spaces in the file lib/defaults.js it works:
renderOpts: { 'pretty': true, 'indent': ' ', 'newline': '\n' },