void (String name, String namespace) { for (int i = 0; i < attributes.size(); i++) { XMLAttribute attr = attributes.get(i); boolean found = attr.getName().equals(name); if (namespace == null) { found &= (attr.getNamespace() == null); } else { found &= attr.getNamespace().equals(namespace); } if (found) { attributes.remove(i); return; } } }