throws DeploymentException {
ArrayList policies = new ArrayList();
Iterator extElements = extElementsList.iterator();
DOMPolicyReader reader = (DOMPolicyReader) PolicyFactory
.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
Object extElement;
while (extElements.hasNext()) {
extElement = extElements.next();
if (extElement instanceof UnknownExtensibilityElement) {
UnknownExtensibilityElement e = (UnknownExtensibilityElement) extElement;
Element element = e.getElement();
if (PolicyConstants.WS_POLICY_NAMESPACE_URI.equals(element
.getNamespaceURI())
&& PolicyConstants.WS_POLICY.equals(element
.getLocalName())) {
policies.add(reader.readPolicy(element));
} else if (PolicyConstants.WS_POLICY_NAMESPACE_URI
.equals(element.getNamespaceURI())
&& PolicyConstants.WS_POLICY_REFERENCE.equals(element
.getLocalName())) {
try {
policies.add(reader.readPolicyReference(element));
} catch (Exception ex) {
logger.debug(Messages.getMessage("policyprocessingerror"));
throw new DeploymentException(Messages.getMessage("policyprocessingerror"));
}