HierarchicalStreamDriver driver = new JettisonMappedXmlDriver();
HierarchicalStreamReader hsr = driver.createReader(is);
// See http://jira.codehaus.org/browse/JETTISON-48
StringWriter writer = new StringWriter();
new HierarchicalStreamCopier().copy(
hsr, new PrettyPrintWriter(writer));
writer.close();
newLayer = (WMSLayer) xs.fromXML(writer.toString());
} else {
throw new RestletException("Unknown or missing format extension: "
+ formatExtension, Status.CLIENT_ERROR_BAD_REQUEST);