ArrayList<StreamSource> schemas = new ArrayList<StreamSource>();
schemas.add(new StreamSource(getClass().getResource("/activemq.xsd").toExternalForm()));
// avoid going to the net to pull down the spring schema,
// REVISIT may need to be smarter in osgi
final PluggableSchemaResolver springResolver =
new PluggableSchemaResolver(getClass().getClassLoader());
final InputSource beanInputSource =
springResolver.resolveEntity(
"http://www.springframework.org/schema/beans",
"http://www.springframework.org/schema/beans/spring-beans.xsd");
if (beanInputSource != null) {
schemas.add(new StreamSource(beanInputSource.getByteStream()));
} else {