title: HTTP requests with basic authentication
body: <p>I have to download and parse XML files from http server <strong>with</strong> HTTP Basic authentication. Now I'm doing it this way:</p>
  
  <pre><code>URL url = new URL("http://SERVER.WITHOUT.AUTHENTICATION/some.xml");
       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       DocumentBuilder db = dbf.newDocumentBuilder();
       Document doc = db.parse(new InputSource(url.openStream()));
       doc.getDocumentElement().normalize();
  </code></pre>
  
  <p>But in that way I can't get xml (or I'm just simply not aware of that ) document from server with http authentication.</p>
  
  <p>I will be really grateful if you can show me the best and easiest way to reach my goal.</p>