code: public static void main(String[] args) throws TransformerConfigurationException, SAXException{
          XSDocument xsd = new XSDocument(new StreamResult(System.out), false, 4, null);
          xsd.startDocument();
          {
              String n1 = "http://www.example.com/N1";
              String n2 = "http://www.example.com/N2";
              xsd.xml().declarePrefix("n1", n1);
              xsd.xml().declarePrefix("n2", n2);
              xsd.startSchema(n1);
              {
                  xsd.addImport(n2, "imports/b.xsd");
                  xsd.startComplexType().name("MyType");
                  {
                      xsd.startCompositor(Compositor.SEQUENCE);
                      xsd.startElement().ref(n1, "e1").endElement();
                      xsd.endCompositor();
                  }
                  xsd.endComplexType();
                  xsd.startElement().name("root").type(n1, "MyType").endElement();
              }
              xsd.endSchema();
          }
          xsd.endDocument();
      }
docs: /*-------------------------------------------------[ Testing ]---------------------------------------------------