title: Null Child Element when Parsing XML with XOM
body: <p>I am using XOM to parse a xml file, but I am having an issue getting an <code>Element</code> by string name. I am able to access each element by iterating through <code>getChild(x)</code> where <code>x=0:ChildCount</code>, but it seems silly to have to hack my way around the software where there is a built-in function to accomplish this task. Why am I getting an NPE? See the example below...I am 100% sure the parent contains a child with the exact name I am searching for. What can I do to solve this?</p>
  
  <pre><code>FileInputStream xmlFile = new FileInputStream("temp.xml");
  Builder builder = new Builder();
  Document doc = builder.build(xmlFile);
  Element root = doc.getRootElement();
  
  System.out.println(((Element)root.getChild(1)).getLocalName()); //--&gt; prints "player"
  Element player = root.getFirstChildElement(((Element)root.getChild(1)).getLocalName()); //--&gt; null
  System.out.println(player); //--&gt; prints "null"
  Element player_stats = player.getFirstChildElement("player_stats"); //--&gt; NPE
  </code></pre>
  
  <p>temp.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;fantasy_content xml:lang="en-US"
  yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/player/nfl.p.7206/stats;type=week;week=2"
  time="34.230947494507ms" copyright="Data provided by Yahoo! and STATS, LLC"
  refresh_rate="31" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
  xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng"&gt;
  &lt;player&gt;
      &lt;player_key&gt;331.p.7206&lt;/player_key&gt;
      &lt;player_id&gt;7206&lt;/player_id&gt;
      &lt;name&gt;
          &lt;full&gt;Heath Miller&lt;/full&gt;
          &lt;first&gt;Heath&lt;/first&gt;
          &lt;last&gt;Miller&lt;/last&gt;
          &lt;ascii_first&gt;Heath&lt;/ascii_first&gt;
          &lt;ascii_last&gt;Miller&lt;/ascii_last&gt;
      &lt;/name&gt;
      &lt;injury_note&gt;not injury related&lt;/injury_note&gt;
      &lt;editorial_player_key&gt;nfl.p.7206&lt;/editorial_player_key&gt;
      &lt;editorial_team_key&gt;nfl.t.23&lt;/editorial_team_key&gt;
      &lt;editorial_team_full_name&gt;Pittsburgh Steelers&lt;/editorial_team_full_name&gt;
      &lt;editorial_team_abbr&gt;Pit&lt;/editorial_team_abbr&gt;
      &lt;bye_weeks&gt;
          &lt;week&gt;12&lt;/week&gt;
      &lt;/bye_weeks&gt;
      &lt;uniform_number&gt;83&lt;/uniform_number&gt;
      &lt;display_position&gt;TE&lt;/display_position&gt;
      &lt;is_undroppable&gt;0&lt;/is_undroppable&gt;
      &lt;position_type&gt;O&lt;/position_type&gt;
      &lt;eligible_positions&gt;
          &lt;position&gt;TE&lt;/position&gt;
      &lt;/eligible_positions&gt;
      &lt;has_player_notes&gt;1&lt;/has_player_notes&gt;
      &lt;player_stats&gt;
          &lt;coverage_type&gt;week&lt;/coverage_type&gt;
          &lt;week&gt;2&lt;/week&gt;
          &lt;stats&gt;
              &lt;stat&gt;
                  &lt;stat_id&gt;0&lt;/stat_id&gt;
                  &lt;value&gt;1&lt;/value&gt;
              &lt;/stat&gt;
              &lt;stat&gt;
                  &lt;stat_id&gt;1&lt;/stat_id&gt;
                  &lt;value&gt;0&lt;/value&gt;
              &lt;/stat&gt;
              &lt;stat&gt;
                  &lt;stat_id&gt;2&lt;/stat_id&gt;
                  &lt;value&gt;0&lt;/value&gt;
              &lt;/stat&gt;
              &lt;stat&gt;
                  &lt;stat_id&gt;3&lt;/stat_id&gt;
                  &lt;value&gt;0&lt;/value&gt;
              &lt;/stat&gt;
  
              ...
  
              &lt;stat&gt;
                  &lt;stat_id&gt;81&lt;/stat_id&gt;
                  &lt;value&gt;0&lt;/value&gt;
              &lt;/stat&gt;
          &lt;/stats&gt;
      &lt;/player_stats&gt;
  &lt;/player&gt;
  &lt;/fantasy_content&gt;
  </code></pre>
  
  <p>Thanks!</p>