title: Custom xmlWriter to skip a certain element?
body: <p>I am implementing a custom xmlwriter and I want to omit any elements with a particular name, like <code>&lt;ABC&gt;</code>.</p>
  
  <p>How do I actually do that? I get a sense that I might need to overwrite the <code>WriteStartElement</code> method like this:</p>
  
  <pre><code>public override void WriteStartElement(string prefix, string localName, string ns)
  {
  
      if (localName.Equals("ABC")) 
      {
          return;
      }
      base.WriteStartElement(prefix, localName, ns);
  }
  </code></pre>
  
  <p>Do I also need to overwrite <code>WriteEndElement</code> method? How do I tell <code>WriteEndElement</code> method to skip writing the end <code>&lt;/ABC&gt;</code> tag? There seems to be no reference of the <code>localName</code> in <code>WriteEndElement</code> method that I can check...?</p>