title: Find an element that only has one other kind of child
body: <p>I want to use XPath to find every <code>&lt;blockquote&gt;</code> element that has at least one child <code>&lt;pre&gt;</code> element, no other kinds of child elements, and optionally text nodes as children:</p>
  
  <pre><code>&lt;body&gt;&lt;div&gt;&lt;!-- arbitrary nesting --&gt;
    &lt;blockquote&gt;&lt;pre&gt;YES&lt;/pre&gt;&lt;/blockquote&gt;
    &lt;blockquote&gt;&lt;p&gt;NO&lt;/p&gt;&lt;/blockquote&gt;
    &lt;blockquote&gt;&lt;pre&gt;NO&lt;/pre&gt;&lt;p&gt;NO&lt;/p&gt;&lt;/blockquote&gt;
    &lt;blockquote&gt;&lt;p&gt;NO&lt;/p&gt;&lt;pre&gt;NO&lt;/pre&gt;&lt;/blockquote&gt;
    &lt;blockquote&gt;&lt;pre&gt;YES&lt;/pre&gt; &lt;pre&gt;YES&lt;/pre&gt;&lt;/blockquote&gt;
    &lt;blockquote&gt;NO&lt;/blockquote&gt;
  &lt;/div&gt;&lt;/body&gt;
  </code></pre>
  
  <p>This XPath appears to work, but I suspect that it's overly complicated:</p>
  
  <pre><code>//blockquote[pre][not(*[not(name()="pre")])]
  </code></pre>
  
  <p>Is there a better (less code, more efficient, more DRY) way to select what I want?</p>