code: private List<Attribute> getAttributes(XMLStreamReader reader) {
          List<Attribute> list = new ArrayList<Attribute>();
          for(int i=0; i<reader.getAttributeCount(); i++) {
              list.add(new Attribute(reader.getAttributeLocalName(i), reader.getAttributeValue(i)));
          }
          return list;
      }
docs: Extract XML element attributes form XML input stream
  @param reader XML reader
  @return {@code List} of {@code Attribute} items