ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
BufferedOutputStream bufferedStream = new BufferedOutputStream(byteStream);
StAXDocumentParser sr = null;
try {
XML_SAX_FI convertor = new XML_SAX_FI();
convertor.convert(xmlfile, bufferedStream);
ByteArrayInputStream byteInputStream = new ByteArrayInputStream(byteStream.toByteArray());
InputStream document = new BufferedInputStream(byteInputStream);
sr = new StAXDocumentParser();
sr.setInputStream(document);