title: Returning XML From a WCF Service
body: <p>I am creating a WCF Web Service in which one method (exposed in Service) return data in XML format as given below:</p>
  
  <pre><code>    public string QueryDirectoryEntry()
      {
  
          XmlDocument doc = new XmlDocument();
          doc.Load(@"c:\" + FILE_NAME);
          return doc.InnerXml;
      }
  </code></pre>
  
  <p>If the client call this method their service return data in XML format , I want to bind this XML in the datagridview control.</p>
  
  <p>The XML data is actually contains the <code>List&lt;MyStruct&gt;</code>.</p>
  
  <pre><code>class MyStruct
  {
    Name..
    ID...
  }
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;root&gt;
    &lt;MyStruct&gt;
      &lt;Name&gt;abc&lt;/Name&gt;
      &lt;ID&gt;1&lt;/ID&gt;
    &lt;/MyStruct&gt;
    &lt;MyStruct&gt;
      &lt;Name&gt;abc&lt;/Name&gt;
      &lt;ID&gt;2&lt;/ID&gt;
    &lt;/MyStruct&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p><strong>I want that data should be in XML</strong> so that every application can use this data either in C# or Java.</p>