Boolean () { final Ref<Boolean> result = new Ref<>(Boolean.FALSE); processChildren(element -> { if (element instanceof XmlAttribute && ((XmlAttribute)element).isNamespaceDeclaration()) { result.set(Boolean.TRUE); return false; } return !(element instanceof XmlToken) || ((XmlToken)element).getTokenType() != XmlTokenType.XML_TAG_END; }); return result.get(); }