@Test
public void testAsXml() throws Exception {

    final HarvestHistory harvestHistory = HarvestHistoryRepositoryTest.createHarvestHistory(_inc);
    harvestHistory.setHarvestDate(new ISODate());
    harvestHistory.setInfo(new Element("rootInfo").addContent(new Element("child").setText("text")));
    harvestHistory.setParams(new Element("rootParam").addContent(new Element("child").setText("text")));
    final Element xml = harvestHistory.asXml();
    assertEquals(harvestHistory.getHarvestDate(), new ISODate(xml.getChildText("harvestdate")));
    final Element info = xml.getChild("info");
    assertTrue(info.getChildren().get(0) instanceof Element);
    final Element params = xml.getChild("params");
    assertTrue(params.getChildren().get(0) instanceof Element);
}