title: Converting XML to string using C#
body: <p>I have a function as below</p>
  <pre><code>public string GetXMLAsString(XmlDocument myxml)
      {
          XmlDocument doc = new XmlDocument();
          doc.LoadXml(myxml);
         
          StringWriter sw = new StringWriter();
          XmlTextWriter tx = new XmlTextWriter(sw);
          doc.WriteTo(tx);
  
          string str = sw.ToString();// 
          return str;
      }
  </code></pre>
  <p>I'm passing an XML to this method from an another method. But in the <code>doc.loadxml()</code>, the system is expecting a string and since I'm passing an XML, it throws error.</p>
  <p>How to solve this issue?</p>