title: Read an XML string in C#
body: <p>I have a string of type <code>string xml = @"&lt;recurrence&gt;&lt;rule&gt;&lt;firstDayOfWeek&gt;mo&lt;/firstDayOfWeek&gt;&lt;repeat&gt;&lt;daily dayFrequency=""1"" /&gt;&lt;/repeat&gt;&lt;windowEnd&gt;2012-10-31T10:00:00Z&lt;/windowEnd&gt;&lt;/rule&gt;&lt;/recurrence&gt;";</code></p>
  
  <p>I want to read <code>dayFrequency</code> value which is <code>1</code> here, is there a way i can directly read <code>dayFrequency</code> under the tag <code>daily</code> and likewise there are many such tags such as <strong>a="1", b="King"</strong> etc. so i want to read directly the value assigned to a variable.</p>
  
  <p>Kindly help.</p>
  
  <p>The below code i used which reads the repeat tag</p>
  
  <pre><code>string xml = @"&lt;recurrence&gt;&lt;rule&gt;&lt;firstDayOfWeek&gt;mo&lt;/firstDayOfWeek&gt;&lt;repeat&gt;&lt;daily dayFrequency=""1"" /&gt;&lt;/repeat&gt;&lt;windowEnd&gt;2012-10-31T10:00:00Z&lt;/windowEnd&gt;&lt;/rule&gt;&lt;/recurrence&gt;";
  
  XmlDocument xmlDoc = new XmlDocument();
  xmlDoc.LoadXml(xml);
  
  // this would select all title elements
  XmlNodeList titles = xmlDoc.GetElementsByTagName("repeat"); 
  </code></pre>