code: protected XmlSchema createXmlSchema(final String encoding, final String targetNamespace) {
          XmlSchema xsd = new XmlSchema(targetNamespace,
                  new XmlSchemaCollection());
          if (targetNamespace != null) {
              xsd.setElementFormDefault(XmlSchemaForm.QUALIFIED);
          }
          xsd.setAttributeFormDefault(null);
          xsd.setInputEncoding(encoding);
          if (targetNamespace == null) {
              NamespaceMap prefixmap = new NamespaceMap();
              NamespacePrefixList npl = xsd.getNamespaceContext();
              if (npl == null) {
                  prefixmap.add("xsd", XMLConstants.W3C_XML_SCHEMA_NS_URI);
              } else {
                  for (int i = 0; i < npl.getDeclaredPrefixes().length; i++) {
                      String prefix = npl.getDeclaredPrefixes()[i];
                      String namespace = npl.getNamespaceURI(prefix);
                      if (namespace.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
                          if (prefix.equals("")) {
                              prefix = "xsd";
                          }
                      }
                      prefixmap.add(prefix, namespace);
                  }
              }
              xsd.setNamespaceContext(prefixmap);
          }
          return xsd;
      }
docs: Create an empty XML Schema.
  <p/>
  If no targetNamespace, make sure there is no default namespace otherwise
  our complex types would be considered part of that default namespace
  (usually XML Schema namespace).
  
  @param encoding the character set used to encode this XML Schema
  @param targetNamespace the target namespace to use (null for no namespace)
  @return a new empty XML schema using the model