void () { doTestWithLocations(null, "xml"); final List<XmlAttribute> attrs = new ArrayList<>(2); myFile.acceptChildren(new XmlRecursiveElementVisitor() { @Override public void visitXmlAttribute(final @NotNull XmlAttribute attribute) { if (!attribute.isNamespaceDeclaration()) attrs.add(attribute); } }); assertEquals(4,attrs.size()); checkAttribute(attrs.get(0), ""); checkAttribute(attrs.get(1), "foo2"); checkAttribute(attrs.get(2), ""); checkAttribute(attrs.get(3), "foo4"); }