var eval = xml.XPathEvaluate("/configuration/log4net/appender/param[@name='File']/@value"); var value = ((IEnumerable)eval).OfType<XAttribute>().Single().Value;