int navigateToNextNode ( Node node ) throws XmlPullParserException { Node nextNode = node . getNextSibling ( ) ; if ( nextNode != null ) { // Move to the next siblings return processNextNodeType ( nextNode ) ; } else { // Goes back to the parent if ( document . getDocumentElement ( ) . equals ( node ) ) { currentNode = null ; return END_DOCUMENT ; } currentNode = node . getParentNode ( ) ; return END_TAG ; } }
Navigate to the next node after a node and all of his children have been explored .