public Document deserialize() throws ConvertException, IOException {
log("\nFound the XSLT deserializer");
Enumeration enumerate = cd.getDocumentEnumeration();
org.w3c.dom.Document domDoc=null;
DOMDocument docOut=null;
GenericOfficeDocument doc = null;
ByteArrayOutputStream baos =null;
GenericOfficeDocument sxwDoc = new GenericOfficeDocument("output");
while (enumerate.hasMoreElements()) {
docOut = (DOMDocument) enumerate.nextElement();
}
domDoc = docOut.getContentDOM();
try{
baos = transform(domDoc);
sxwDoc.initContentDOM();
DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
dFactory.setNamespaceAware(true);
DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
sxwDoc.setContentDOM(dBuilder.parse(new ByteArrayInputStream(baos.toByteArray())));
}
catch(Exception e){
System.out.println("The following error occurred:"+e);
}