Use:
//node()[not(node())]
In case only element leaf nodes are wanted (and this needs clarification -- are elements that have non-element children considered leaf nodes?), then the following XPath expression selects them:
//*[not(*)]
Both expressions above are probably the shortest that select the desired nodes (either any-node or element -- leaf nodes).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…