Creating Dictionary from list
<p>I want to prepare a dictionary from xml file nested with list because as have multiple values against one key.
 below code I am using for this - </p>

<pre><code>  for (int i = 0; i &lt; NumberOfVariation; i++)
    {
        SingleVariationDom.LoadXml(VariationSet[i].OuterXml);
        XmlNodeList CASInputParam = SingleVariationDom.GetElementsByTagName("CASInputParam");
        string Attr = null;
         ObjList.Clear();
        for (int j = 0; j &lt; CASInputParam.Count; j++)
        {
            if (j == 0)
            {
                var NonTabularValueElement = SingleVariationDom.GetElementsByTagName("CASInputParam")[0];
                Attr = NonTabularValueElement.Attributes["MailParam"].Value;
            }
            else
            {
                var NonTabularValueElement = SingleVariationDom.GetElementsByTagName("CASInputParam")[j];
                string Attribut = NonTabularValueElement.Attributes["MailParam"].Value;
                ObjList.Add(Attribut);
            }
        }

        ObjParentDiction.Add(Attr, ObjList);

    }
</code></pre>

<p>When I am clearing the list object <code>ObjList</code> its clearing the values of dictionary in which I have already added values as a list. </p>

<p>Please suggest to avoid it.</p>
