Added [text()] syntax to retrieve all elements with non empty text
diff --git a/path.go b/path.go
index f200332..a2cefa2 100644
--- a/path.go
+++ b/path.go
@@ -26,6 +26,7 @@
     [tag]           Selects all elements with a child element named tag
     [tag='val']     Selects all elements with a child element named tag
                       and text matching val
+    [text()]        Selects all elements with non empty text
     [text()='val']  Selects all elements whose text matches val
 
 Examples:
@@ -278,10 +279,12 @@
 		}
 	}
 
-	// Filter contains [@attr], [N] or [tag]
+	// Filter contains [@attr], [N], [tag] or [text()]
 	switch {
 	case path[0] == '@':
 		return newFilterAttr(path[1:])
+	case strings.HasPrefix(path, "text()"):
+		return newFilterTextAll()
 	case isInteger(path):
 		pos, _ := strconv.Atoi(path)
 		switch {
@@ -432,14 +435,25 @@
 // text equal to the specified value.
 type filterTextVal struct {
 	val string
+	all bool
 }
 
 func newFilterTextVal(value string) *filterTextVal {
-	return &filterTextVal{value}
+	return &filterTextVal{val: value}
+}
+
+func newFilterTextAll() *filterTextVal {
+	return &filterTextVal{all: true}
 }
 
 func (f *filterTextVal) apply(p *pather) {
 	for _, c := range p.candidates {
+		if f.all {
+			if c.Text() != "" {
+				p.scratch = append(p.scratch, c)
+			}
+			continue
+		}
 		if c.Text() == f.val {
 			p.scratch = append(p.scratch, c)
 		}
diff --git a/path_test.go b/path_test.go
index 12a4e21..ce6338c 100644
--- a/path_test.go
+++ b/path_test.go
@@ -17,6 +17,7 @@
 		<author>Giada De Laurentiis</author>
 		<year>2005</year>
 		<p:price>30.00</p:price>
+		<editor>Clarkson Potter</editor>
 	</book>
 
 	<book category="CHILDREN">
@@ -24,6 +25,8 @@
 		<author>J K. Rowling</author>
 		<year>2005</year>
 		<p:price>29.99</p:price>
+		<editor></editor>
+		<editor/>
 	</book>
 
 	<book category="WEB">
@@ -35,6 +38,8 @@
 		<author>Vaidyanathan Nagarajan</author>
 		<year>2003</year>
 		<p:price>49.99</p:price>
+		<editor>
+		</editor>
 	</book>
 
 	<!-- Final book -->
@@ -95,6 +100,7 @@
 	{"//book[price='29.99']/title", "Harry Potter"},
 	{"//book/price[text()='29.99']", "29.99"},
 	{"//book/author[text()='Kurt Cagle']", "Kurt Cagle"},
+	{"//book/editor[text()]", []string{"Clarkson Potter", "\n\t\t"}},
 
 	// attribute queries
 	{"./bookstore/book[@category='WEB']/title", []string{"XQuery Kick Start", "Learning XML"}},