code: private static boolean isDescendant(
  		final Node n,
  		final Node ref) {
  		if (ref == null) {
  			return false;
  		} // end if
  
  		if (n == ref) {
  			return true;
  		} // end if
  
  		NodeList nl = ref.getChildNodes();
  
  		for (int i = 0; i < nl.getLength(); i++) {
  			boolean result = isDescendant(n, nl.item(i));
  
  			if (result) {
  				return result;
  			} // end if
  		} // end for
  
  		return false;
  	}
docs: return true if n is a descendant of ref
  
  @param n node to test
  @param ref reference node
  
  @return true if n is a descendant of ref