title: WCF object serialization using attribute
body: <p>I am new to this stuff. I am using WCF in C#. Suppose you have a WebService which returns entity A having fields aa and bb</p>
  
  <p>This entity can be represented using:</p>
  
  <pre><code>[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.ns.com")]
  public partial class A{
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public bool Aa;  
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public bool Bb;
  }
  </code></pre>
  
  <p>When i call the WS, it generates the response xml</p>
  
  <pre><code>&lt;A&gt;
     &lt;Aa&gt;&lt;/Aa&gt;
     &lt;Bb&gt;&lt;Bb&gt;
  &lt;/A&gt;
  </code></pre>
  
  <p>I need it to generate the output rather like this:</p>
  
  <pre><code>&lt;a aa="" bb=""/&gt;
  </code></pre>
  
  <p>How do i do this?</p>