Have you considered using a
Dictionary
for storing these values? Here is how you can build it from XML.
This code will take all the
values
tags and store all its descendants as a dictionary.
string xml = @"<start>
<valuetype>testFeature1</valuetype>
<values><a>1</a>2</values>
<valuetype>testFeature2</valuetype>
<values><x>10</x><y>20</y></values>
</start>";
XDocument xDocument = XDocument.Parse(xml);
Dictionary<string,string> dynamicThings = xDocument.Root.Elements()
.Where(x=> x.Name == "values")
.Descendants()
.Select(x => new { Key = x.Name, Value = x.Value })
.ToDictionary(x => x.Key.ToString(), x => x.Value);