public String asPath() {
StringBuffer buffer = new StringBuffer();
NodePointer parent = getImmediateParentPointer();
if (parent != null) {
buffer.append(parent.asPath());
}
if (index != WHOLE_COLLECTION) {
// Address the list[1][2] case
if (parent != null && parent.getIndex() != WHOLE_COLLECTION) {
buffer.append("/.");