@Test
public void testReexportCiteSF1()
                        throws ClassCastException, ClassNotFoundException, InstantiationException,
                        IllegalAccessException, XMLStreamException, FactoryConfigurationError, IOException {

    String schemaURL = this.getClass().getResource( "../cite/schema/cite-gmlsf1.xsd" ).toString();
    GMLAppSchemaReader adapter = new GMLAppSchemaReader( GMLVersion.GML_31, null, schemaURL );
    AppSchema schema = adapter.extractAppSchema();
    XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
    outputFactory.setProperty( XMLOutputFactory.IS_REPAIRING_NAMESPACES, true );
    OutputStream os = new FileOutputStream( System.getProperty( "java.io.tmpdir" ) + File.separatorChar + "out.xml" );
    XMLStreamWriter writer = new IndentingXMLStreamWriter( outputFactory.createXMLStreamWriter( os ) );
    GMLAppSchemaWriter encoder = new GMLAppSchemaWriter( GMLVersion.GML_31, "http://cite.opengeospatial.org/gmlsf",
                                                         null, schema.getNamespaceBindings() );
    encoder.export( writer, schema );
    writer.close();
}