title: Is it possible to remove a YamlNode from a YamlDocument
body: <p>I'm looking to implement an extension method similar to this:</p>
  
  <pre><code>public static bool RemoveNode(this YamlDocument doc, YamlNode node)
  {
  
  }
  </code></pre>
  
  <p>Basically, I have a <code>YamlDocument</code>, and a <code>YamlNode</code> I would like to remove from that document.  Neither <code>YamlDocument</code> or <code>YamlNode</code> appear to have any sort of <code>Remove</code> method.  Judging by the <a href="https://github.com/aaubry/YamlDotNet/blob/master/YamlDotNet/RepresentationModel/YamlMappingNode.cs" rel="nofollow noreferrer">source code</a>, it looks like child nodes (at least for Mapping Nodes) are stored in the <code>children</code> dictionary, which could be accessed through the <code>Children</code> property.  I would probably also need to solve this for removing sequence nodes and scalar nodes.  If anyone has solved this issue, I'd love to hear your approach.</p>
  
  <p>Also, I ran across another library called SharpYaml (which appears to be a fork of YamlDotNet) which has methods build in to remove nodes.  However, at the moment it would be somewhat of a high cost to switch out Yaml libraries.  So, that's a last resort.</p>