public XmlElementDescriptor[] getSubstitutes(String localName, String namespace) {
    List<XmlElementDescriptor> result = new ArrayList<XmlElementDescriptor>();

    initSubstitutes();

    List<XmlTag> substitutions = mySubstitutions.get(localName);
    if (substitutions == null) return XmlElementDescriptor.EMPTY_ARRAY;
    for (XmlTag tag : substitutions) {
      final String substAttr = tag.getAttributeValue("substitutionGroup");
      if (substAttr != null && checkElementNameEquivalence(localName, namespace, substAttr, tag)) {
        result.add(createElementDescriptor(tag));
      }
    }

    return result.toArray(new XmlElementDescriptor[result.size()]);
  }
 public boolean hasSubstitutions() {
   initSubstitutes();
   return mySubstitutions != null && mySubstitutions.size() > 0;
 }