code: protected Boolean attributeAsBoolean(XMLStreamReader reader, String attributeName, Boolean defaultValue,
                                          Map<String, String> expressions)
        throws XMLStreamException, ParserException
     {
        String attributeString = rawAttributeText(reader, attributeName);
  
        if (attributeName != null && expressions != null && attributeString != null &&
            attributeString.indexOf("${") != -1)
           expressions.put(attributeName, attributeString);
        
        String stringValue = getSubstitutionValue(attributeString);
        if (StringUtils.isEmpty(stringValue) || stringValue.trim().equalsIgnoreCase("true") ||
            stringValue.trim().equalsIgnoreCase("false"))
        {
           return StringUtils.isEmpty(stringValue) ? defaultValue : Boolean.valueOf(stringValue.trim());
        }
        else
        {
           throw new ParserException(bundle.attributeAsBoolean(attributeString, reader.getLocalName()));
        }
     }
docs: convert an xml attribute in boolean value. Empty elements results in default value
  
  @param reader the StAX reader
  @param attributeName the name of the attribute
  @param defaultValue  defaultValue
  @param expressions The expressions
  @return the boolean representing element
  @throws XMLStreamException StAX exception
  @throws ParserException in case of not valid boolean for given attribute