StreamResult result = new StreamResult(baos);
transformer.transform(source, result);
XStreamPersisterFactory xpf = GeoServerExtensions.bean(XStreamPersisterFactory.class);
XStreamPersister persister = xpf.createXMLPersister();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
return persister.load(bais, DimensionInfo.class);
}
}