private String xmlDocumentToString(Document document) throws TransformerException {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        StringWriter writer = new StringWriter();
        transformer.transform(new DOMSource(document), new StreamResult(writer));
        return writer.getBuffer().toString();
    }
Read the wsdl from input stream (xml)

@param wsdlStream the wsdl(xml) as stream
@return the wsdl as document
manager/api/rest-impl/src/main/java/io/apiman/manager/api/schema/format/WsdlRewriter.java