public XmlNode rootNode(string filename, string startingNode) { //Get project/file dir var dataDir = Libary.GetDataFileDir(); var fileDir = dataDir + filename; //Load the filename XmlDocument doc = new XmlDocument(); doc.Load(fileDir); XmlNode root = doc.DocumentElement.SelectSingleNode(startingNode); return(root); }