code: protected final String generateElemPrefix(String suggPrefix, String nsURI,
                                                SimpleOutputElement elem)
          throws XMLStreamException
      {
          /* Ok... now, since we do not have an existing mapping, let's
           * see if we have a preferred prefix to use.
           */
          /* Except if we need the empty namespace... that can only be
           * bound to the empty prefix:
           */
          if (nsURI == null || nsURI.length() == 0) {
              return "";
          }
  
          /* Ok; with elements this is easy: the preferred prefix can
           * ALWAYS be used, since it can mask preceding bindings:
           */
          if (suggPrefix == null) {
              // caller wants this URI to map as the default namespace?
              if (mSuggestedDefNs != null && mSuggestedDefNs.equals(nsURI)) {
                  suggPrefix = "";
              } else {
                  suggPrefix = (mSuggestedPrefixes == null) ? null:
                      mSuggestedPrefixes.get(nsURI);
                  if (suggPrefix == null) {
                      /* 16-Oct-2005, TSa: We have 2 choices here, essentially;
                       *   could make elements always try to override the def
                       *   ns... or can just generate new one. Let's do latter
                       *   for now.
                       */
                      if (mAutoNsSeq == null) {
                          mAutoNsSeq = new int[1];
                          mAutoNsSeq[0] = 1;
                      }
                      suggPrefix = elem.generateMapping(mAutomaticNsPrefix, nsURI,
                                                        mAutoNsSeq);
                  }
              }
          }
  
          // Ok; let's let the caller deal with bindings
          return suggPrefix;
      }
docs: Method called after {@link #findElemPrefix} has returned null,
  to create and bind a namespace mapping for specified namespace.