title: Java DocumentBuilderFactory.parse(); returning null document
body: <p>When I call <code>DocumentBuilderFactory.parse(xml-file-path);</code>, it returns a null document. I am 100% sure that the file path for the document is right.My full code is as follows:</p>
  
  <pre><code>public static boolean readXML(String xml) {
      Document dom;
      // Make an instance of the DocumentBuilderFactory
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      try {
          // use the factory to take an instance of the document builder
          DocumentBuilder db = dbf.newDocumentBuilder();
          // parse using the builder to get the DOM mapping of the
          // XML file
          dom = db.parse(xml);
  
          System.out.println(dom + " " + xml + " " + dom.getElementById("1"));
  
          Element doc = dom.getDocumentElement();
  
          System.out.println(doc);
  
          address = getTextValue(address, doc, "address");
          System.out.println(address);
          return true;
  
      } catch (ParserConfigurationException pce) {
          System.out.println(pce.getMessage());
      } catch (SAXException se) {
          System.out.println(se.getMessage());
      } catch (IOException ioe) {
          System.err.println(ioe.getMessage());
      }
  
      return false;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>XMLReaderWriter.readXML("C:\\Users\\username\\eclipse-workspace\\project\\src\\preferences.xml");
  </code></pre>
  
  <p>Preferences.xml is simply:</p>
  
  <pre><code>&lt;address&gt;idk just filler for now&lt;/address&gt;
  </code></pre>
  
  <p>The return I get is:</p>
  
  <p><a href="https://i.stack.imgur.com/wbCYt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wbCYt.png" alt="error"></a></p>
  
  <p>Why is it returning a null document?</p>