code: public static boolean getAttributeAsBoolean(XmlPullParser parser, String attributeName, boolean defaultValue) throws Exception {
  		// parser.getText()
  		String value = parser.getAttributeValue(null, attributeName);
  
  		if (!StringUtils.hasText(value)) {
  			return defaultValue;
  		}
  
  		return Boolean.parseBoolean(value);
  	}
docs: Gets the attribute as boolean.
  
  @param parser the parser
  @param attributeName the attribute name
  @param defaultValue the default value
  @return get attribute as boolean
  @throws Exception the exception