private void extract(Document source){
  Node node=source.getDocumentElement();
  if (node != null) {
    offer(node);
    extract(node);
  }
}

private void extract ( Document source ) { Node node = source . getDocumentElement ( ) ; if ( node != null ) { offer ( node ) ; extract ( node ) ; } }
this is used to extract the nodes of the document in such a way that it can be navigated as a queue . in order to do this each node encountered is pushed in to the queue so that when finished the nodes can be dealt with as a stream .
