@Override public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException {
  try {
    if (result instanceof StreamResult) {
      return new WbXmlStreamWriter(new FileOutputStream(result.getSystemId()),(WbXmlDefinition)props.get(DEFINITION_PROPERTY),(WbXmlEncoder.StrtblType)props.get(ENCODING_TYPE_PROPERTY),(Boolean)props.get(SKIP_SPACES_PROPERTY));
    }
 else {
      throw new XMLStreamException("WBXML only support StreamResult!");
    }
  }
 catch (  IOException e) {
    throw new XMLStreamException(e);
  }
}

@ Override public XMLStreamWriter createXMLStreamWriter ( Result result ) throws XMLStreamException { try { if ( result instanceof StreamResult ) { return new WbXmlStreamWriter ( new FileOutputStream ( result . getSystemId ( ) ) , ( WbXmlDefinition ) props . get ( DEFINITION_PROPERTY ) , ( WbXmlEncoder . StrtblType ) props . get ( ENCODING_TYPE_PROPERTY ) , ( Boolean ) props . get ( SKIP_SPACES_PROPERTY ) ) ; } else { throw new XMLStreamException ( "WBXML only support StreamResult!" ) ; } } catch ( IOException e ) { throw new XMLStreamException ( e ) ; } }
create a new xmlstreamwriter that writes to a jaxp result . it only works with a streamresult .
