title: Parse XML document securely
body: <p>How do I parse an XML document securely so that it does not allow external entities as part of an incoming XML document? I am using DOM parser -</p>
  
  <pre><code>Document test = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(byteArrayInputStream))
  </code></pre>