Get the non-empty element using XPATH December 20, 2023 by Tarik This xpath should work as well: //group/p1[string-length(text()) > 0]