}
public EXISerializer(OutputStream exiOutputStream, InputStream xsdInputStream) throws EXIException, IOException {
final EXIFactory exiFactory = DefaultEXIFactory.newInstance();
final GrammarFactory grammarFactory = GrammarFactory.newInstance();
final Grammar g = grammarFactory.createGrammar(xsdInputStream);
exiFactory.setGrammar(g);
encoder = new SAXEncoder(exiFactory);
encoder.setOutputStream(exiOutputStream);
}