protected String getProcessingInstructionValue (Node contNode, String key) throws ParseException {
        String strValue = null;
        NodeList nl = contNode.getChildNodes();
        for (int i = 0; i < nl.getLength(); i++) {
            if (nl.item(i).getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
                String strTarget = ((ProcessingInstruction) nl.item(i)).getTarget();
                if (strTarget.equals(key)) {
                    strValue = ((ProcessingInstruction) nl.item(i)).getData();  // get value
                    // remove the processing instruction
                    Node parent = nl.item(i).getParentNode();                    
                    parent.removeChild(nl.item(i));
                    break;
                }
            }
        }
        return strValue;
    }