public static string GetValue(this XmlDocument doc, string xpath) { if (doc.DocumentElement.SelectSingleNode(xpath) != null) return doc.SelectSingleNode(xpath).InnerText; else return ""; }