protected static Document createDocument(String document) throws PolicyIndexException {

        // parse policy document and create dom
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder builder;
        try {
            builder = factory.newDocumentBuilder();
            Document doc = builder.parse(new InputSource(new StringReader(document)));
            return doc;
        } catch (ParserConfigurationException e) {
            throw new PolicyIndexException(e);
        } catch (SAXException e) {
            throw new PolicyIndexException(e);
        } catch (IOException e) {
            throw new PolicyIndexException(e);
        }
    }
protected static Document createDocument ( String document ) throws PolicyIndexException { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; factory . setNamespaceAware ( true ) ; DocumentBuilder builder ; try { builder = factory . newDocumentBuilder ( ) ; Document doc = builder . parse ( new InputSource ( new StringReader ( document ) ) ) ; return doc ; } catch ( ParserConfigurationException e ) { throw new PolicyIndexException ( e ) ; } catch ( SAXException e ) { throw new PolicyIndexException ( e ) ; } catch ( IOException e ) { throw new PolicyIndexException ( e ) ; } }
create an XML Document from the policy document