title: Best xml validator in nodejs
body: <p>Hi I am trying to check if the xml data is a valid one or not in nodejs.I used the xmldoc module but it didnt seem to throw me any error when i passed a wrong xml data.
  I also tried xmltojson parser below is my code</p>
  
  <pre><code> var xml2js = require('xml2js')
   var parser = new xml2js.Parser();
   parser.on('end', function(POST_VALUE) {
   console.log(POST_VALUE)
   });
   parser.parseString(POST_VALUE);
  </code></pre>
  
  <p>In POST_VALUE i passed a invalid xml still it didnt throw me any error but did not return any json data 
  I further analysed that there is a option called validator.But it is denoted as a callable.And am not sure how to use that.</p>
  
  <p>I am stuck here any help will be much helpful. </p>