ProcessingInstruction pI, pI2;
String compare;
boolean OK = true;
// For debugging***** println("\n testPI's outputs:\n");
pI = (ProcessingInstruction) document.getDocumentElement().getFirstChild();// Get doc's ProcessingInstruction
pI2 = (org.apache.xerces.dom.ProcessingInstructionImpl) pI.cloneNode(true);//*****?
// Check nodes for equality, both their name and value or lack thereof
if (!(pI.getNodeName().equals(pI2.getNodeName()) && // Compares node names for equality
(pI.getNodeValue() != null && pI2.getNodeValue() != null) // Checks to make sure each node has a value node
? pI.getNodeValue().equals(pI2.getNodeValue()) // If both have value nodes test those value nodes for equality
:(pI.getNodeValue() == null && pI2.getNodeValue() == null)))// If one node doesn't have a value node make sure both don't