private void processDataFromConnection_asXML(String str)
protected void processDataFromConnection_asXML(String str)
    private void processDataFromConnection_asXML(String str)    {            try{                    //ByteArrayInputStream bais = new ByteArrayInputStream(str.getBytes());                    //InputSource is = new InputSource(bais);                    StringReader sr = new StringReader(str.trim());                    InputSource is = new InputSource(sr);                    //System.err.println("str=" + str);                    //FileReader freader = new FileReader("task.xml");                    //InputSource is = new InputSource(freader);                    //myDOMParser = new DOMParser();                    myDOMParser.setErrorHandler(new ErrorHandler(){                          public void error(SAXParseException exception) {                             System.err.println("[ErrorHandler.error]: " + exception);                           }                           public void fatalError(SAXParseException exception) {                                 System.err.println("[ErrorHandler.fatalError]: " + exception);                           }                           public void warning(SAXParseException exception) {                                 System.err.println("[ErrorHandler.warning]: " + exception);                            }                        }                    );                    //                    // .reset() DISABLED:                    // USE seems to occasionally corrupt document created.                    //myDOMParser.reset();                    myDOMParser.parse(is);                    Document doc = myDOMParser.getDocument();                    System.out.println("Is XML");                    if( doc != null ) {                       PlanObject p = new PlanObject(doc);                       System.out.println("[Aggregator Plugin] Pub PlanObject, PlanObject Root doc elem="                                          + doc.getDocumentElement().getNodeName());                       publishAdd(p);                    }            } catch ( SAXParseException sax) {                    //                    // if we see this, assume this is not valid XML                    //                    System.out.println("Not XML");                    System.out.println("\n[AggregatorPlugin] data=" + str + "\n");            } catch (Exception ex ){                    ex.printStackTrace();            }    }