如何使用 XPath select 所有空元素

How to select all empty elements with XPath

假设以下标记:

<html>
  <body>
    <p>
      <strong>  </strong>
      <strong>
      </strong>
      <strong><em>Bar</em>  </strong>
      <strong><em>  </em>  </strong>
    </p>
  </body>
</html>

如何使用 XPath 查询获取以下元素?

<strong>  </strong>
<strong>
</strong>
<strong><em>  </em>  </strong>

我认为前两种情况都类似于 //*[normalize-space(text()) = '' and not(node())],但事实并非如此。我不知道如何捕捉第三种情况。

更准确地说:我正在搜索所有仅包含白色 space 的节点、新行和具有相同内容的子节点。

以下 XPath 查询将它们全部捕获:

//*[not(normalize-space())]

但不是:

<strong><em>Bar</em>  </strong>