title: Modify XElement to have different content
body: <p>I have an XElement which it's output is </p>
  
  <pre><code>&lt;Email&gt;address@email.com&lt;/Email&gt;
  </code></pre>
  
  <p>. Base on some criteria I will possibly need to remove the email address and set it to null. I know I can yous set element.Value =""; but that will not do what I want. I want to modify it so the output will become: </p>
  
  <pre><code>&lt;Email xsi:nil=\"true\" /&gt;
  </code></pre>
  
  <p>I don't want to create a brand new node because this is a referenced node within a document. and i want to keep the node where it is within the document.
  I tried </p>
  
  <pre><code>emailItem.Add(new XAttribute("xsi:nil", "true"));
  </code></pre>
  
  <p>but I received the following exception</p>
  
  <blockquote>
    <p>The ':' character, hexadecimal value 0x3A, cannot be included in a
    name.
    The following changes create the node almost correctly:</p>
  </blockquote>
  
  <pre><code>XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance";                                    
  emailItem.Add(new XAttribute(xsi + "nil", true));
  emailItem.Value =""; //How do I set to Null?
  </code></pre>
  
  <p>I end up with  <code>&lt;Email xsi:nil="true"&gt;&lt;/Email&gt;</code> instead  <code>&lt;Email xsi:nil="true"/&gt;</code></p>