title: How to remove elements from a document?
body: <p>Is there a way to iterate through a document and remove all <code>&lt;:p /&gt;</code> elements if they don't have any runs?
  I am trying to remove paragraphs if they look something like this:</p>
  
  <pre><code>&lt;w:p&gt;
      &lt;w:pPr&gt;
          &lt;w:pStyle w:val="Heading1" /&gt;
          &lt;w:numPr&gt;
              &lt;w:ilvl w:val="0" /&gt;
              &lt;w:numId w:val="0" /&gt;
          &lt;/w:numPr&gt;
          &lt;w:ind w:left="432" /&gt;
      &lt;/w:pPr&gt;
  &lt;/w:p&gt;
  </code></pre>
  
  <p>Here is what I have so far, but it only removes empty <code>&lt;w:p /&gt;</code> elements.</p>
  
  <pre><code>foreach (Paragraph P in D.Descendants&lt;Paragraph&gt;().Where(x =&gt; !x.HasChildren).ToList()
  </code></pre>