To use this, do this:
$ cat ~/tmp/Test.java
package foo;
public class Test {
private int x;
}
$ java net.sourceforge.pmd.util.XPathTest -xpath "//FieldDeclaration" -filename "/home/tom/tmp/Test.java"
Match at line 3 column 11; package name 'foo'; variable name 'x'