StringWriter buff = new StringWriter();
marshaller.marshal(doc1, buff);
System.out.println("XML:\n" + buff);
Document<Record> doc2 = (Document<Record>) marshaller.unmarshal(new StringReader(buff.toString()));
assertNotNull(doc2);
assertNotNull(doc2.records);
assertEquals(1, doc2.records.size());
Record rec2 = doc2.records.get(0);