title: Unexpected token < when parsing XML in NodeJS
body: <p>I've tried to use <a href="https://www.npmjs.com/package/xml2js" rel="nofollow noreferrer"><code>xml-js</code></a> and <a href="https://www.npmjs.com/package/xml-js" rel="nofollow noreferrer"><code>xml2js</code></a> but both are returning the same error.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  ^
  
  SyntaxError: Unexpected token &lt;
      at createScript (vm.js:80:10)
      at Object.runInThisContext (vm.js:139:10)
      at Module._compile (module.js:616:28)
      at Object.Module._extensions..js (module.js:663:10)
      at Module.load (module.js:565:32)
      at tryModuleLoad (module.js:505:12)
      at Function.Module._load (module.js:497:3)
      at Module.require (module.js:596:17)
      at require (internal/module.js:11:18)
  </code></pre>
  
  <p>The xml example:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;note&gt;
    &lt;to&gt;Tove&lt;/to&gt;
    &lt;from&gt;Jani&lt;/from&gt;
    &lt;heading&gt;Reminder&lt;/heading&gt;
    &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  </code></pre>
  
  <p>The code example:</p>
  
  <pre><code>var notes =require('./test.xml')
  
  var convert = require('xml-js');
  var xml =notes;
  
  var result1 = convert.xml2json(xml, {compact: true, spaces: 4});
  var result2 = convert.xml2json(xml, {compact: false, spaces: 4});
  
  console.log(result1, '\n', result2);
  </code></pre>
  
  <p>Can you help with the solution to this? I've tried using <code>JSON.parse</code>, <code>JSON.stringify</code> but it is not working anyways.</p>
  
  <p>I'm trying to parse an XML to convert to JSON, by the way.</p>