XmlHelper { public String objectToXml(Object obj) throws JAXBException { return objectToXml(obj, false); }  String objectToXml(Object obj); String objectToXml(Object obj, boolean formatted); @SuppressWarnings("unchecked") T unmarshallXmlToObject(Class<T> classType, String xmlString);  }
@Test public void testObjectToXml() throws Exception { assertEquals(getTestXml(), xmlHelper.objectToXml(getTestBuildInformation())); }
@Test public void testObjectToXmlFormatted() throws Exception { assertEquals(getTestXml().replaceAll("\\s+",""), xmlHelper.objectToXml(getTestBuildInformation(), true).replaceAll("\\s+","")); }