try
{
InputSource input = new InputSource(is);
input.setSystemId(file.toURI().toString());
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setEntityResolver(new JBossEntityResolver());
SAXSource source = new SAXSource(reader, input);
JAXBElement<ManagedConnectionFactoryDeploymentGroup> elem = um.unmarshal(source, ManagedConnectionFactoryDeploymentGroup.class);
ManagedConnectionFactoryDeploymentGroup deployment = elem.getValue();
repository.addManagedConnectionFactoryDeploymentGroup(deployment);
return deployment;