private void addQualifiers(List<Class<? extends Enum<?>>> allQualifiersSorted, Element schemaEl) throws DOMException {
        for (Class<? extends Enum<?>> qualClass : allQualifiersSorted) {
            Element simpleTypeEl = schemaEl.getOwnerDocument().createElement("xs:simpleType");
            schemaEl.appendChild(simpleTypeEl);
            simpleTypeEl.setAttribute("name", qualClass.getSimpleName() + "Enum");
            Element restrictionEl = schemaEl.getOwnerDocument().createElement("xs:restriction");
            simpleTypeEl.appendChild(restrictionEl);
            restrictionEl.setAttribute("base", "xs:string");

            for (Enum e : qualClass.getEnumConstants()) {
                Element enumEl = schemaEl.getOwnerDocument().createElement("xs:enumeration");
                restrictionEl.appendChild(enumEl);
                enumEl.setAttribute("value", e.toString());
            }
        }
    }