This one works for both leaves and nodes, scalars and arrays.
Implements Comparable so that it can be sorted lexicographically. author: Kohsuke Kawaguchi (kk@kohsuke.org)