ClassPathResource resource = new ClassPathResource("org/activemq/activemq-to-spring.xsl");
StreamSource source = new StreamSource(resource.getInputStream(), resource.getURL().toString());
Transformer transformer = ActiveMQBeanDefinitionReader.createTransformer(source);
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
builder.setEntityResolver(new ActiveMQDtdResolver());
Document document = builder.parse(new ClassPathResource("org/activemq/config/example.xml").getFile());
transformer.transform(new DOMSource(document), new StreamResult(new File("target/example-spring.xml")));
}