RDFXMLSerializer { public void workflowDoc(OutputStream outputStream, Workflow wf, URI path) throws JAXBException, WriterException { org.apache.taverna.scufl2.xml.Workflow wfElem = makeWorkflow(wf, path); WorkflowDocument doc = objectFactory.createWorkflowDocument(); doc.getAny().add(wfElem); URI wfUri = uriTools.relativeUriForBean(wf, wfBundle); doc.setBase(uriTools.relativePath(path, wfUri).toASCIIString()); JAXBElement<RDF> element = rdfObjectFactory.createRDF(doc); getMarshaller().marshal(element, outputStream); seeAlsoUris.put(wf, path); } RDFXMLSerializer();  RDFXMLSerializer(WorkflowBundle wfBundle); void annotation(final Annotation ann); JAXBContext getJaxbContext(); Marshaller getMarshaller(); WorkflowBundle getWfBundle(); boolean isUsingSchema(); void profileDoc(OutputStream outputStream, Profile pf, URI path); void setJaxbContext(JAXBContext jaxbContext); void setUsingSchema(boolean usingSchema); void setWfBundle(WorkflowBundle wfBundle); void workflowBundleDoc(OutputStream outputStream, URI path); void workflowDoc(OutputStream outputStream, Workflow wf, URI path);  }
@Test public void workflow() throws Exception { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); serializer.workflowDoc(outStream, workflowBundle.getMainWorkflow(), URI.create(HELLOWORLD_RDF)); Document doc = parseXml(outStream); Element root = doc.getRootElement(); checkRoot(root); checkWorkflowDocument(root); }