I was using below code when my XML has a single element of 'HTTPSamplerProxy' now I have multiple elements with the same name and I want all to store.
XElement HTTPSamplerProxy = doc.Descendants("HTTPSamplerProxy").FirstOrDefault();
path = (string)HTTPSamplerProxy.Elements("stringProp").Where(x => (string)x.Attribute("name") == "HTTPSampler.path").FirstOrDefault();
domain = (string)HTTPSamplerProxy.Elements("stringProp").Where(x => (string)x.Attribute("name") == "HTTPSampler.domain").FirstOrDefault();
method = (string)HTTPSamplerProxy.Elements("stringProp").Where(x => (string)x.Attribute("name") == "HTTPSampler.method").FirstOrDefault();