DomNode.isEmpty

bool isEmpty() @nogc nothrow pure @safe const

Does it have no children that are elements or non-empty text? Comments and processing instructions don't count (as for the :empty selector).