public static List<Attr> getAttributes(Element e) {
        List<Attr> attrs = new ArrayList<>();
        NamedNodeMap attrMap = e.getAttributes();
        int length = attrMap.getLength();
        for (int i = 0; i < length; i++) {
            attrs.add((Attr) attrMap.item(i));
        }
        return attrs;
    }