How can I read the XML file Node attributes and Child node attributes values?
<p>How can I read the xml file having contents :</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;A&gt;
   &lt;B value="1"&gt;
     &lt;Hash algo="SHA256" value="905C45B51B970434D7159641D9F6A88DC91E9C35030618A729C8E4BE174711AF" /&gt;
   &lt;/B&gt;
   &lt;B value="2"&gt;
     &lt;Hash algo="SHA256" value="649721FF455E9B100E691A3857696350E14364029C34C9438AB3EA9665C91292" /&gt;
   &lt;/B&gt;
   &lt;B value="3"&gt;
     &lt;Hash algo="SHA256" value="90FC91C4B82BF440FDAFECF3303DCA8FB9F2E9D7EFFAE394D8B74D0C7CD7DA10" /&gt;
   &lt;/B&gt;
&lt;/A&gt;
</code></pre>

<p>In the above xml file I want to read the values of all <code>B</code> tag's "value" attribute values and the tag <code>Hash</code> "algorithm" or "value" attributes value.</p>

<p>Here is the code that I am using:</p>

<pre><code>        var settings = new XmlReaderSettings();
        settings.IgnoreWhitespace = true;
        using (var stm = new FileStream(@"xmlFilePath", FileMode.Open, FileAccess.Read, FileShare.Read))
        using (var reader = XmlReader.Create(stm, settings))
        {
            while (reader.Read())
            {
                string srcFileHash=null;
                reader.ReadToDescendant("B");
                if (reader.NodeType == XmlNodeType.Element &amp;&amp; reader.LocalName == "B")
                {
                    reader.MoveToAttribute("value");
                    var bValue=reader.Value;   // get the B tag attribute value.

                    //also want to read the &lt;hash value=? and algo=?. but I dnt know how to get these hash tag attributes.
                }
            }
        }
</code></pre>
