I\'ve xml as following:
Log In
This is an old question, but in case someone comes across a 'Typed'
xml (e.g from a SharedPreference
file of an android app), you can handle it as below: Here is a sample of such an xml I took from an Instagram
app.
Note the inconsistency in the value property. Some fields(e.g of type string
) don't have it explicitly defined.
var elements = XElement.Load(filePath)
.Elements()
.ToList();
var dict = new Dictionary();
var _dict = elements.ToDictionary(key => key.Attribute("name").Value,
val => val.Attribute("value") != null ?
val.Attribute("value").Value : val.Value);