ArrayList<XmlAttribute> (boolean updateModCount) { final ArrayList<XmlAttribute> list = new ArrayList<>(Arrays.asList(myRootTag.getAttributes())); final Iterator<XmlAttribute> it = list.iterator(); while (it.hasNext()) { final XmlAttribute attribute = it.next(); if (!attribute.isNamespaceDeclaration() || !attribute.isValid()) it.remove(); if (updateModCount) { attribute.putUserData(MOD_COUNT, attribute.getContainingFile().getModificationStamp()); } } return list; }