Microsoft Windows may add a Byte-Oder-Mark character to the start of XML files. When encountering such a byte-chain xml2js breaks with error message
'error parsing xml: Error: Non-whitespace before first tag.\nLine: 0\nColumn: 1\nChar: '
Thanks for filing that issue. I need to think a bit about the different types of BOM (the incorrect UTF-8 one, and UTF-16BE and UTF-16LE) and how to strip them away at best.
Stripping BOM if at the beginning of file
Can you test if this works for you? I might even add a maintenance release, because this issue seems to be bugging so many peaople, according to the blog post.