title: WCF, XmlRoot, and optional parameters
body: <p>I have a WCF service and cannot use DataContracts since I need more control over the XML received and sent to this service. As such, I use XmlRoot, and XmlElement... the problem I'm running into now is that my class that the receiving xml gets deserialized into and the serialized response both need to have the same root name, and when I try to set both of those classes with:</p>
  
  <pre><code>[XmlRoot(ElementName = "myRoot")] 
  </code></pre>
  
  <p>I get an error saying that the root name was already used. Is there a simple workaround for this? I tried putting my response class in a separate namespace but that didn't appear to work.</p>
  
  <p>If some of the variables aren't set in my response class that gets serialized then I don't them to get serialized and returned in the response... is there an option I'm missing to do this... I was able to do this with a DataContract, but cant figure it out with XmlElements</p>