score:1

Accepted answer

Your best bet is to iterate over the "entry" elements and assign their values to fields of the MemberViewModel object as you discover them.

Something like this:

 public static MemberViewModel ParseMemberXML(string xml)
 {
    XDocument data = XDocument.Parse(xml);

    // expecting exactly one
    XElement userdata = data.Root.Element("userdata");

    var obj = new MemberViewModel();
    obj.Account = userdata.Element("account").Element("account").Value;

    foreach (var entry in userdata.Element("userprofile").Elements("entry"))
    {
        switch (entry.Element("name").Value)
        {
            case "primaryFirstName": obj.PrimaryFirstName = entry.Element("value").Value; break;
            case "primaryLastName": obj.PrimaryLastName = entry.Element("value").Value;
    ...etc...
        }
    }

    return obj;
}

You could instead use XPath expressions to select individual elements by specifying their parentage path, but frankly I think the foreach loop is more manageable.