@Override public void write(OutputStream out) { ObjectFactory owsFactory = new ObjectFactory(); try { JAXBElement<OWSContextType> exportedOwsContextType = owsFactory.createOWSContext(getJAXBObject()); Marshaller marshaller = org.orbisgis.coremap.map.JaxbContainer.JAXBCONTEXT.createMarshaller(); marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE); marshaller.marshal(exportedOwsContextType, out); } catch (JAXBException ex) { throw new IllegalArgumentException( I18N.tr("Error raised while exporting the map context"), ex); } }