// Finally, apply pictureLayoutTree2DiagramDataXslt to create DiagramData part
// ByteArrayOutputStream layoutBAOS3 = new ByteArrayOutputStream();
// Result result = new StreamResult(layoutBAOS3);
JAXBResult result = new JAXBResult(Context.jc );
java.util.HashMap<String, Object> settings = new java.util.HashMap<String, Object>();
settings.put("list", xml);
settings.put("DiagramDataPart", data);
XmlUtils.transform(
new javax.xml.transform.stream.StreamSource(
new java.io.StringReader(tmpXslStr)),
layoutTree2DiagramDataXslt, settings, result);
// What did we generate
// tmpXslStr = layoutBAOS3.toString("UTF-8");
// System.out.println(tmpXslStr);
// Finally, inject this into your DiagramData part
// .. first, we need to make the IDs Word friendly.
Object ddJaxb = result.getResult();
DiagramDataPart.setFriendlyIds(XmlUtils.unwrap(ddJaxb));
//System.out.println(XmlUtils.marshaltoString(ddJaxb, false));
return (CTDataModel)XmlUtils.unwrap(ddJaxb);