result.iterator() will give you an iterator of type Map<String,Object> where each map represents a "row"- the String is the column name and value is the column value (p in your case).
If you just want the results of a single column, you can do result.columnAs("p") which, in your case will give you an Iterator<Node>.
-Luanne