code: public static int optionalIntAttribute(
              final XMLStreamReader reader,
              final String localName,
              final int defaultValue) {
          return optionalIntAttribute(reader, null, localName, defaultValue);
      }
docs: Returns the value of an attribute as a int. If the attribute is empty, this method returns
  the default value provided.
  
  @param reader
  <code>XMLStreamReader</code> that contains attribute values.
  @param localName
  local name of attribute (the namespace is ignored).
  @param defaultValue
  default value
  @return value of attribute, or the default value if the attribute is empty.