xml parsing problem in c#
<pre><code>&lt;Root&gt;
  &lt;Application&gt;
  &lt;AppName&gt;App1&lt;/AppName&gt;
  &lt;IdMark&gt;ClassName&lt;/IdMark&gt;
  &lt;ClassName&gt;Notepad&lt;/ClassName&gt;
  &lt;ExecName&gt;Notepad&lt;/ExecName&gt;
  &lt;Mod&gt;
    &lt;ModName&gt;HookPrintAPIs&lt;/ModName&gt;
    &lt;Api&gt;
      &lt;ApiName&gt;TextOutA&lt;/ApiName&gt;
      &lt;ApiName&gt;TextOutW&lt;/ApiName&gt;
      &lt;ApiName&gt;ExtTextOutA&lt;/ApiName&gt;
      &lt;ApiName&gt;ExtTextOutW&lt;/ApiName&gt;
      &lt;ApiName&gt;DrawTextA&lt;/ApiName&gt;
      &lt;ApiName&gt;DrawTextW&lt;/ApiName&gt;
      &lt;ApiName&gt;DrawTextExA&lt;/ApiName&gt;
      &lt;ApiName&gt;DrawTextExW&lt;/ApiName&gt;
      &lt;ApiName&gt;GdiDrawString&lt;/ApiName&gt;
    &lt;/Api&gt;
  &lt;/Mod&gt;
  &lt;/Application&gt;
&lt;/Root&gt;
</code></pre>

<p>i have an xml file i want parse this x,l file and then want to store in an object how it is possible</p>

<p>i have used parsing technique like this</p>

<pre><code>ArrayList oArrayListForModuleName = new ArrayList();
ArrayList oArrayListClass = new ArrayList();
ArrayList oArrayListApi = new ArrayList();
List&lt;string&gt; oListofApiName1 = new List&lt;string&gt;();
while (oRreader.Read())
 {
  if (oRreader.NodeType == XmlNodeType.Element)
    {
     switch (oRreader.Name)
      {
        case "AppName":
                      oRreader.Read();
                      oArrayListClass.Add(oRreader.Value);
                      break;
        case "IdMark":
                      oRreader.Read();
                      oArrayListClass.Add(oRreader.Value);
                      break;
        case "ClassName":
                      oRreader.Read();
                      oArrayListClass.Add(oRreader.Value);
                      break;
        case "ExecName":
                      oRreader.Read();
                      oArrayListClass.Add(oRreader.Value);
                      break;
        case "ModName":
                      oRreader.Read();
                      oArrayListForModuleName.Add(oRreader.Value);
                      break;
        case "ApiName":
                      oRreader.Read();
                      oArrayListApi.Add(oRreader.Value);
                      oListofApiName1.Add(oRreader.Value);
                      break;
                    }
                }
            }
oRreader.Close();
for (int i = 0; i &lt; oArrayListApi.Count; i++)
{
 if (oArrayListApi[i].Equals("Not Set"))
  {
       oArrayListApi[i] = "";
  }
}

for (int i = 0; i &lt; oArrayListForModuleName.Count; i++)
 {
  if (oArrayListForModuleName[i].Equals("Not Set"))
     {
     oArrayListForModuleName[i] = "";
     }
 }
 int counter = 0;
 int countformod = 0;
 while (j &lt; oArrayListClass.Count)
   {
    CConfigManager oXmlHook = new CConfigManager();
    oXmlHook.uAppName = oArrayListClass[j].ToString();
    oXmlHook.uIdMark = oArrayListClass[++j].ToString();
    oXmlHook.uClassName = oArrayListClass[++j].ToString();
    oXmlHook.uExecName = oArrayListClass[++j].ToString();
    for (int cntr = 0; cntr &lt; countofapi; cntr++)
      {
       oXmlHook.oListOfApiName.Add(oArrayListApi[counter].ToString());
       counter++;
       }
    for (int c = 0; c &lt; countofmodule; c++)
      {
       oXmlHook.oListOfModuleName.Add(oArrayListForModuleName[countformod].ToString());
       countformod++;
      }
    oArrListOfObject.Add(oXmlHook);
    j++;
}
</code></pre>
