XmlDocument doc = new XmlDocument(); using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8)) { contents = streamReader.ReadToEnd(); } doc.LoadXml(contents);