title: reading xml file with XmlReader reads only the first element
body: <p>I'm having problems reading child elements with XmlReader.</p>
  
  <p>My xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;WateringZones&gt;
     &lt;WateringZone&gt;
        &lt;Enabled&gt;True&lt;/Enabled&gt;
        &lt;Name&gt;Calle 1&lt;/Name&gt;
        &lt;Relay&gt;1&lt;/Relay&gt;
        &lt;Monday&gt;True&lt;/Monday&gt;
        &lt;Tuesday&gt;True&lt;/Tuesday&gt;
        &lt;Wednesday&gt;True&lt;/Wednesday&gt;
        &lt;Thursday&gt;True&lt;/Thursday&gt;
        &lt;Friday&gt;True&lt;/Friday&gt;
        &lt;Saturday&gt;True&lt;/Saturday&gt;
        &lt;Sunday&gt;False&lt;/Sunday&gt;
        &lt;WateringTurns&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;True&lt;/Enabled&gt;
              &lt;Name&gt;Turno 1&lt;/Name&gt;
              &lt;Minutes&gt;5&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;True&lt;/Enabled&gt;
              &lt;Name&gt;Turno 2&lt;/Name&gt;
              &lt;Minutes&gt;5&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;True&lt;/Enabled&gt;
              &lt;Name&gt;Turno 3&lt;/Name&gt;
              &lt;Minutes&gt;5&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 4&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 5&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 6&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 7&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 8&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
        &lt;/WateringTurns&gt;
     &lt;/WateringZone&gt;
     &lt;WateringZone&gt;
        &lt;Enabled&gt;True&lt;/Enabled&gt;
        &lt;Name&gt;Calle 2&lt;/Name&gt;
        &lt;Relay&gt;2&lt;/Relay&gt;
        &lt;Monday&gt;False&lt;/Monday&gt;
        &lt;Tuesday&gt;True&lt;/Tuesday&gt;
        &lt;Wednesday&gt;False&lt;/Wednesday&gt;
        &lt;Thursday&gt;False&lt;/Thursday&gt;
        &lt;Friday&gt;True&lt;/Friday&gt;
        &lt;Saturday&gt;True&lt;/Saturday&gt;
        &lt;Sunday&gt;False&lt;/Sunday&gt;
        &lt;WateringTurns&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;True&lt;/Enabled&gt;
              &lt;Name&gt;Turno 1&lt;/Name&gt;
              &lt;Minutes&gt;5&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 2&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 3&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 4&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 5&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 6&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 7&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
           &lt;WateringTurn&gt;
              &lt;Enabled&gt;False&lt;/Enabled&gt;
              &lt;Name&gt;Turno 8&lt;/Name&gt;
              &lt;Minutes&gt;0&lt;/Minutes&gt;
           &lt;/WateringTurn&gt;
        &lt;/WateringTurns&gt;
     &lt;/WateringZone&gt;
  &lt;/WateringZones&gt;
  </code></pre>
  
  <p>and I'm trying to read this file with the following code:</p>
  
  <pre><code>    private void LoadFromXml(string filename)
      {
          try
          {
              int sprinkler = 0;
              int sprinklerTurn = 0;
  
              // Create an XML reader for this file.
              using (XmlReader reader = XmlReader.Create(filename))
              {
                  while (reader.Read())
                  {
                      // Only detect start elements.
                      if (reader.IsStartElement())
                      {
                          while (reader.Read())
                          {
                              Console.WriteLine(reader.NodeType + ": " + reader.LocalName + "\n");
  
                              if (reader.NodeType.Equals(XmlNodeType.Element))
                              {
                                  // Get element name and switch on it.
                                  switch (reader.LocalName)
                                  {
                                      case "WateringZone":
                                          {
                                              sprinklerTurn = 0;
  
                                              // Detect this element.
                                              if (reader.ReadToFollowing("Enabled"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Enabled = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Name"))
                                              {
                                                  wateringScheluder.WateringZones[sprinkler].Name = reader.ReadElementContentAsString();
                                              }
  
                                              if (reader.ReadToFollowing("Relay"))
                                              {
                                                  wateringScheluder.WateringZones[sprinkler].Relay = reader.ReadElementContentAsInt();
                                              }
  
                                              if (reader.ReadToFollowing("Monday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Monday = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Tuesday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Tuesday = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Wednesday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Wednesday = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Thursday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Thursday = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Friday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Friday = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Saturday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Saturday = Convert.ToBoolean(enabled);
                                              }
  
                                              if (reader.ReadToFollowing("Sunday"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].Sunday = Convert.ToBoolean(enabled);
                                              }
  
                                              // Esperamos el signiente springle
                                              sprinkler++;
                                          }
                                          break;
                                      case "WateringTurn":
                                          {
                                              if (reader.ReadToFollowing("Enabled"))
                                              {
                                                  var enabled = reader.ReadElementContentAsString();
                                                  wateringScheluder.WateringZones[sprinkler].WateringTurns[sprinklerTurn].Enabled = Convert.ToBoolean(enabled);
                                              }
                                              if (reader.ReadToFollowing("Name"))
                                              {
                                                  wateringScheluder.WateringZones[sprinkler].WateringTurns[sprinklerTurn].Name = reader.ReadElementContentAsString();
                                              }
                                              if (reader.ReadToFollowing("Minutes"))
                                              {
                                                  wateringScheluder.WateringZones[sprinkler].WateringTurns[sprinklerTurn].Minutes = reader.ReadElementContentAsInt();
                                              }
  
                                              // Esperamos el siguiente turno
                                              sprinklerTurn++;
                                          }
                                          break;
                                      default:
                                          // ignore other nodes
                                          break;
                                  }
                              }
                          }
                      }
                  }
              }
          }
          catch (Exception e)
          {
              MessageBox.Show("No se pudo cargar, el mensaje de error fue :" + e.Message);
          }
      }
  </code></pre>
  
  <p>But it only reads the first <code>&lt;WateringZone&gt;</code> and then <code>reader.Read()</code> returns <code>false</code>,  isn't supposed to continue reading <code>&lt;WateringTurns&gt;</code> ?</p>