try
{
outStream.close(); // before we parse the InputStream make sure the pipe is closed.
parser = org.openxml.DOMFactory.createParser( pis, null, org.openxml.DOMFactory.DOCUMENT_XML );
doc = parser.parseDocument();
}
catch(java.io.IOException ioe)
{
System.err.println(ioe.toString());
ioe.printStackTrace();