@Test
@SuppressWarnings("Since15")
public void testToDocument() throws Exception {

	Resource resource = new ClassPathResource("org/springframework/ws/soap/soap11/soap11.xml");
	DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactoryUtils.newInstance();
	documentBuilderFactory.setNamespaceAware(true);
	DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
	Document expected = documentBuilder.parse(SaxUtils.createInputSource(resource));
	SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(resource.getInputStream(), null);
	SOAPMessage soapMessage = builder.getSOAPMessage();
	Document result = AxiomUtils.toDocument(soapMessage.getSOAPEnvelope());
	assertXMLEqual("Invalid document generated from SOAPEnvelope", expected, result);
}