Element (@NotNull Element parent, String childName, List<String> namespaces) { Element element = parent.getChild(childName); if (element != null) return element; for (String namespace : namespaces) { element = parent.getChild(childName, Namespace.getNamespace(namespace)); if (element != null) return element; } return null; }