title: Java: Having trouble parsing XML with nested nodes
body: <p>I have an XML file with something like this</p>
  
  <pre><code>&lt;album&gt;
      &lt;title&gt; Sample Album &lt;/title&gt;
      &lt;year&gt; 2014 &lt;/year&gt;
      &lt;musicalStyle&gt; Waltz &lt;/musicalStyle&gt;
          &lt;song&gt; Track 1 &lt;/song&gt;
          &lt;song&gt; Track 2 &lt;/song&gt;
          &lt;song&gt; Track 3 &lt;/song&gt;
          &lt;song&gt; Track 4 &lt;/song&gt;
          &lt;song&gt; Track 5 &lt;/song&gt;
          &lt;song&gt; Track 6 &lt;/song&gt;
          &lt;song&gt; Track 7 &lt;/song&gt;
  &lt;/album&gt;
  </code></pre>
  
  <p>I was able to parse the song by following a tutorial but now I'm stuck with the nested nodes.
  Song.XMLtitleStartTag = <code>&lt;title&gt;</code> and the end tag being <code>&lt;/title&gt;</code></p>
  
  <pre><code>public static SongList parseFromFile(File inputFile){
      System.out.println("Parse File Data:");     
      if(inputFile == null) return null;      
      SongList theSongs  = new SongList();        
      BufferedReader inputFileReader;
  
      String inputLine; //current input line
      try{
             inputFileReader= new BufferedReader(new FileReader(inputFile));
  
             while((inputLine = inputFileReader.readLine()) != null){
                 if(inputLine.trim().startsWith(Song.XMLtitleStartTag) &amp;&amp; 
                     inputLine.endsWith(Song.XMLtitleEndTag)){
  
                     String titleString = inputLine.substring(Song.XMLtitleStartTag.length()+1, 
                             inputLine.length()- Song.XMLtitleEndTag.length()).trim();
  
                     if(titleString != null &amp;&amp; titleString.length() &gt; 0)
                         theSongs.add(new Song(titleString))              
                 }
             } 
  </code></pre>
  
  <p>I understand there are different ways to parse XML, I was wondering if I should stick to the method I'm using and build off of it, or should I try a different, easier approach.</p>
  
  <p>Also wondering if I could get a pointer with parsing the rest of the album information if possible</p>