static boolean isElementParentName ( Element element , String name ) { Element parent = element . getParentElement ( ) ; if ( parent == null ) { return false ; } return isElementName ( parent , name ) ; }
Returns true if an elements parents name is same as argument