OCCIProcesser { public String tags2UpperCase(String payload) throws JDOMException, IOException { SAXBuilder builder = new SAXBuilder(); builder.setValidation(false); builder.setIgnoringElementContentWhitespace(true); Document xmldoc = builder.build(new StringReader(payload)); XPath xpath = XPath.newInstance(" List result = xpath.selectNodes(xmldoc); Iterator it = result.iterator(); while(it.hasNext()){ Element element = (Element)it.next(); element.setName(element.getName().toUpperCase()); element.setNamespace(null); } XMLOutputter outputter = new XMLOutputter(); ByteArrayOutputStream parsed = new ByteArrayOutputStream(); outputter.output(xmldoc, parsed); return parsed.toString(); }  String tags2UpperCase(String payload); String tags2LowerCase(String payload); String getSaveAsPayload(String original); String getIdFromHref(String href);  }
@Test public void testTags2UpperCase() { try { assertEquals(UPPERCASEXML, processer.tags2UpperCase(LOWERCASEXML)); } catch (JDOMException e) { e.printStackTrace(); fail(e.getMessage()); } catch (IOException e) { e.printStackTrace(); fail(e.getMessage()); } }