}
private Element getPolicy(List<?> extensibilityElements, String name) {
for (Object ep : extensibilityElements) {
ExtensibilityElement ext = (ExtensibilityElement)ep;
if (ext instanceof UnknownExtensibilityElement) {
UnknownExtensibilityElement uExt = (UnknownExtensibilityElement)ext;
if (RMUtils.getPolicyConstants().getPolicyQName().equals(ext.getElementType())) {
Element elem = uExt.getElement();
String id = elem.getAttributeNS(RMUtils.getPolicyConstants().getWSUNamespaceURI(), "Id");
if (null == name || name.equals(id)) {
return elem;
}
} else if (RMUtils.getPolicyConstants().getPolicyReferenceQName()
.equals(ext.getElementType())) {
Element elem = uExt.getElement();
String uri = elem.getAttribute("URI");
if (uri.startsWith("#") && uri.length() > 1) {
Element referenced = getPolicy(def.getExtensibilityElements(), uri.substring(1));
if (null != referenced) {