} catch (PropertyException e) {
Activator.getLogger().debug("Property is not supported", e);
}
Object value = model.marshalRootElement();
Document doc = model.getDoc();
Element docElem = doc.getRootElement();
// JAXB only seems to do nice whitespace/namespace stuff when writing to stream
// rather than DOM directly
// marshaller.marshal(value, docElem);
StringWriter buffer = new StringWriter();
marshaller.marshal(value, buffer);
// now lets parse the XML and insert the root element into the doc
String xml = buffer.toString();
if (!model.getNs().equals(springNS)) {
// !!!
xml = xml.replaceAll(springNS, model.getNs());
}
Document camelDoc = parse(new XMLStringSource(xml));
Node camelElem = camelDoc.getRootElement();
// TODO
//val camelElem = doc.importNode(element, true)
if (model.isRoutesContext() && camelDoc.getRootElement().getName().equals("camelContext")) {
camelDoc.getRootElement().setName("routeContext");
}
if (model.isJustRoutes()) {
replaceChild(doc, camelElem, docElem);
} else {
if (model.getNode() != null) {