How to get the value for multiple subnode in xml?
<ol>
<li><p>Xml code:</p>

<pre><code>    &lt;Report&gt;
      &lt;ChartData&gt;
        &lt;ListName&gt;area&lt;/ListName&gt;
        &lt;ViewName&gt;Selecte List&lt;/ViewName&gt;
        &lt;YAxisFields&gt;
          &lt;YAxisField&gt;
            &lt;Name&gt;Scheduled Start Date/Time&lt;/Name&gt;
            &lt;DataType&gt;DateTime&lt;/DataType&gt;
            &lt;Category&gt;Year&lt;/Category&gt;
          &lt;/YAxisField&gt;
        &lt;/YAxisFields&gt;
        &lt;XAxisFields&gt;
          &lt;XAxisField&gt;
            &lt;Name&gt;Release Type&lt;/Name&gt;
            &lt;DataType&gt;String&lt;/DataType&gt;
            &lt;Category&gt;
            &lt;/Category&gt;
          &lt;/XAxisField&gt;
        &lt;/XAxisFields&gt;
      &lt;/ChartConfig&gt;
   &lt;/Report&gt;
</code></pre></li>
<li><p>I got the value for the subnode listname and viewname by using the
                below code,</p>

<pre><code>    XmlDocument doc = new XmlDocument();
    doc.Load("XmlFileName"); 
    XmlNodeList node = doc.SelectNodes("Report/ChartData"); 
    foreach (XmlNode xn in node) 
    { xn["ListName"].InnerXml = chartname; 
    xn["ViewName"].InnerXml = SelectedList; 
    **xn["YAxisFields/YAxisField"].InnerXml = yaxisfield; //not working, need to get the value for this xml node,need help in this line dono how to proceed**
    doc.Save("XmlFilename"); 
    }
</code></pre></li>
<li><p>First i have tried with code like this instead of above code,in this
                i need to create number of objects in order get the value for each
                node so i tried by creating object for xmlnodelist then i used
                foreach loop to get the value for each node but in this couldnt get
                the value for YAxisFields/YAxisField because it also has parent node
                as YAxisFields and subnode as YAxisField so there is only way to
                create number of objects for xmlnode or is there any other way to do
                this?</p>

<pre><code>    XmlDocument doc = new XmlDocument();
    doc.Load("XmlFileName");
    XmlNode Listnode = doc.SelectSingleNode("Report/ChartData/ListName"); 
    XmlNode Viewnode = doc.SelectSingleNode("Report/ChartData/ViewName");
            if (Listnode != null)
            {
                Listnode.InnerXml = chartname;
                Viewnode.InnerXml = SelectedList; ;
                doc.Save("XmlFileName");
</code></pre></li>
</ol>
