I am very new to C#. I have XML file (text.xml). I want to read that in XmlDocument and store the stream in string variable.
XmlDocument
Use XmlDocument.Load() method to load XML from your file. Then use XmlDocument.InnerXml property to get XML string.
XmlDocument.Load()
XmlDocument.InnerXml
XmlDocument doc = new XmlDocument(); doc.Load("path to your file"); string xmlcontents = doc.InnerXml;