title: How to convert a XmlDocument to a XLANGMessage type?
body: <p>How can I convert a XmlDocument to a XLANGMessage type?<br>
  I have tried with below method,
  Below two methods throws error  : "Cannot Implicitly convert XmlDocument to XLangMessage... </p>
  
  <p>Any other thoughts, please share.  </p>
  
  <p>TRY1--</p>
  
  <pre><code>public XLANGMessage convertToXlandMsgFromXml(XmlDocument tempInput)
  {
      XLANGMessage sampleOutput;            
      tempInput.Load(@"InputMessage.xml");            
      XLANGMessage sampleOutput = tempInput;            
  }  
  </code></pre>
  
  <p>TRY2--  </p>
  
  <pre><code>public class FileStreamFactory : IStreamFactory
  {
      string _fname;
  
      public FileStreamFactory(string fname)
      {
          _fname = fname;
      }
  
      public Stream CreateStream()
      {
          return new FileStream
                 (
                  _fname,
                  FileMode.Open,
                  FileAccess.Read,
                  FileShare.Read
                 );
      }
      }  
  
      public static void AssignStreamFactoryToPart(XLANGMessage msg)
      {
          IStreamFactory sf = new FileStreamFactory( @"c:\\data.xml" );
          msg[0].LoadFrom( sf );
      }
  }
  </code></pre>