using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
string test = "/whitelist/locations/location/var-fields/var-field[@key=\"whitelist-entry\" and @value=\"8.0440147AA44A80\"]";
string lastElement = test.Split('/').LastOrDefault();
var reg = new Regex("\".*?\"");
var matches = reg.Matches(lastElement);
Console.WriteLine("Key is: "+key);
Console.WriteLine("Value is "+@value);