{ try { //get performance Variable IXml performance = webAppAccess.getVariables().getXml("performance"); //if toGet is blank, return all rows if (toGet.equals("")) return performance; //otherwise, iterate through each row and assemble an XML object //consisting of the rows that match toGet IXml result = XmlUtil.parseXml(""); List theList = performance.getChildren("Row"); //for each entry in theList... for (Iterator it = theList.iterator(); it.hasNext();) { IXml thisEntry = (IXml)it.next(); //check to see if the Area of the current entry equals toGet if (thisEntry.findElement("Area").getText().equals(toGet)) { //create a new XML entry in the result XML based on the values in thisEntry IXml newEntry = result.addChildElement("Row"); newEntry.addChildWithText("Name", thisEntry.findElement("Name").getText()); newEntry.addChildWithText("Area", thisEntry.findElement("Area").getText()); newEntry.addChildWithText("NewCustomers", thisEntry.findElement("NewCustomers").getText()); newEntry.addChildWithText("TotalSales", thisEntry.findElement("TotalSales").getText()); newEntry.addChildWithText("FeedbackRating", thisEntry.findElement("FeedbackRating").getText()); newEntry.addChildWithText("Comments", thisEntry.findElement("Comments").getText()); } } //return the result return result; } //if there is an IOException, return null catch (java.io.IOException e) { return null; } }