I ran this, let example3 = { annotation: {xxx: '1111', arr: [ { toy: 'Transformers' } , { toy: 'GI Joe' }, { toy: 'He-man' } ]} }; let result1 = xml(example3, {indent: '\t'}) and the result1 was: '\<annotation/\>'