public Element current(){
  if (elementStack == null) {
    return first();
  }
  if (!elementStack.empty()) {
    StackItem item=elementStack.peek();
    Element elem=item.getElement();
    int index=item.getIndex();
    if (index == -1) {
      return elem;
    }
    return elem.getElement(index);
  }
  return null;
}

public Element current ( ) { if ( elementStack == null ) { return first ( ) ; } if ( ! elementStack . empty ( ) ) { StackItem item = elementStack . peek ( ) ; Element elem = item . getElement ( ) ; int index = item . getIndex ( ) ; if ( index == - 1 ) { return elem ; } return elem . getElement ( index ) ; } return null ; }
fetches the current element .
