title: Java Dom Parser won't return child nodes
body: <p>I am attempting to parse an XML document and for some reason I can't get any child nodes from anything. I have tired everything I know. I originally tried using Dom4J but had major difficulties in regards to namespaces. Now I am attempting to use the standard DOM parser. </p>
  
  <p>I've read through the oracle tutorial as well as others but see no advice on why my most basic of functions is failing. </p>
  
  <p>I'll start by sharing my code: </p>
  
  <pre><code>package testingtemp;
  
  import org.w3c.dom.*;
  import javax.xml.parsers.*;
  import java.io.*;
  
  public class DomParser {
  
      public static void main(String args[]){
  
          try{
  
              File inputFile = new File("C:\\Users\\jhamric\\Desktop\\Camt54.xml");
              DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
              DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
              Document doc = dBuilder.parse(inputFile);
              doc.getDocumentElement().normalize();
              System.out.println("Root Element: "+doc.getDocumentElement().getChildNodes());
  
          }catch (Exception e){
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>So simply all I want to do is return the child nodes for the root (which is "document".) There is one child node that should be returned. </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  
  -&lt;Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.04"&gt;
  
  
       -&lt;BkToCstmrDbtCdtNtfctn&gt;
  
  
           +&lt;GrpHdr&gt;
  
  
           -&lt;Ntfctn&gt;
  
                    &lt;Id&gt;161RD2521JI00XSZ&lt;/Id&gt;
  
                    &lt;CreDtTm&gt;2016-01-27T13:25:21&lt;/CreDtTm&gt;
  </code></pre>
  
  <p>This is just a very small portion of my Xml but you can clearly see thatBkToCstmrDbtCdtNtfctn should be returned as a child node in the print screen. Instead my console output looks like this:</p>
  
  <pre><code>Root Element: [Document: null]
  </code></pre>
  
  <p>It reports back the correct root element but then tells me there are no child nodes. What gives? Any help would be greatly appreciated!</p>