void (@NotNull Reader reader, @NotNull Consumer<String> consumer) { try (reader) { NanoXmlUtil.parse(reader, new NanoXmlBuilder() { private boolean elementStarted; @Override public void startElement(@NonNls String name, @NonNls String nsPrefix, @NonNls String nsURI, String systemID, int lineNr) { elementStarted = nsPrefix != null && nsURI.equals(XmlUtil.XML_SCHEMA_URI) && name.equals("element"); } @Override public void addAttribute(@NonNls String key, String nsPrefix, String nsURI, String value, String type) { if (elementStarted && key.equals("name")) { consumer.accept(value); elementStarted = false; } } }); } catch (IOException ignore) { } }