QName partQN = p.getElementName();
if (partQN == null) {
throw new WSIFException("part has no QName");
}
ElementType et = null;
for (int i=0; i<l.size() && et==null; i++ ){
Object o = l.get(i);
if ( o instanceof ElementType ) {
QName etQN = ((ElementType)o).getTypeName();
if ( partQN.equals(etQN) ){
et = (ElementType)o;
}
}
}
if (et == null) {
throw new WSIFException("no ElementType found for part: " + p);
}
List children = et.getChildren();
if (children == null || l.size()<1) {
throw new WSIFException("no ComplexType children on elementType: " + et);
}
ComplexType ct = (ComplexType) children.get(0);