docs: public static void validateMergedXML(BeanMetaData bmd)
                      throws EJBConfigurationException
      {
          if (!validationEnabled()) {
              return;
          }
  
          if (bmd.metadataComplete || bmd.wccm == null ||
              bmd.isManagedBean() || bmd.isEntityBean())
          {
              return;
          }
  
          EJBJar mergedEJBJar = bmd.ivInitData.ivModuleInitData.getMergedEJBJar();
          if (mergedEJBJar == null)
          {
              return;
          }
  
          Session msb = null;
          List<String> errors = new ArrayList<String>();
          EnterpriseBean meb = WCCMMetaData.getEnterpriseBeanNamed(mergedEJBJar, bmd.enterpriseBeanName);
  
          if (meb == null)
          {
              errors.add(MERGE + "is missing an EJB named " + bmd.enterpriseBeanName);
              logErrors(bmd.j2eeName, errors);
              return;
          }
  
          // -----------------------------------------------------------------------
          // Common processing for all bean types / partial BMD
          // -----------------------------------------------------------------------
  
          // Required : <ejb-name>
          if (!bmd.enterpriseBeanName.equals(meb.getName()))
          {
              errors.add(MERGE + "<ejb-name> : " + meb.getName() +
                         ", expected : " + bmd.enterpriseBeanName);
          }
  
          if (meb instanceof ComponentViewableBean)
          {
              ComponentViewableBean cvb = (ComponentViewableBean) meb;
  
              // Required : <home> (if a home is present)
              String mebHomeName = cvb.getHomeInterfaceName();
              if (!equals(bmd.homeInterfaceClassName, mebHomeName))
              {
                  errors.add(MERGE + "<home> : " + mebHomeName +
                             ", expected : " + bmd.homeInterfaceClassName);
              }
  
              // Required : <local-home> (if a local home is present)
              String mebLocalHomeName = cvb.getLocalHomeInterfaceName();
              if (!equals(bmd.localHomeInterfaceClassName, mebLocalHomeName))
              {
                  errors.add(MERGE + "<local-home> : " + mebLocalHomeName +
                             ", expected : " + bmd.localHomeInterfaceClassName);
              }
          }
  
          // Required : <ejb-class>
          if (!bmd.enterpriseBeanClassName.equals(meb.getEjbClassName()))
          {
              errors.add(MERGE + "<ejb-class> : " + meb.getEjbClassName() +
                         ", expected : " + bmd.enterpriseBeanClassName);
          }
  
          // -----------------------------------------------------------------------
          // Session Bean processing / partial BMD
          // -----------------------------------------------------------------------
  
          if (bmd.isSessionBean())
          {
              if (meb.getKindValue() != EnterpriseBean.KIND_SESSION)
              {
                  errors.add(MERGE + "bean type is incorrect, should be <session>");
                  logErrors(bmd.j2eeName, errors);
                  return;
              }
  
              msb = (Session) meb;
  
              // Required : <business-local> (if business local are present)
              List<String> msbLocalBusinessClasses = msb.getLocalBusinessInterfaceNames();
              String[] msbLocalBusiness = msbLocalBusinessClasses.toArray(new String[msbLocalBusinessClasses.size()]);
  
              if (!setEquals(bmd.ivBusinessLocalInterfaceClassNames, msbLocalBusiness))
              {
                  errors.add(MERGE + "<business-local> : " + Arrays.toString(msbLocalBusiness) +
                             ", expected : " + Arrays.toString(bmd.ivBusinessLocalInterfaceClassNames));
              }
  
              // Required : <business-remote> (if business remote are present)
              List<String> msbRemoteBusinessClasses = msb.getRemoteBusinessInterfaceNames();
              String[] msbRemoteBusiness = msbRemoteBusinessClasses.toArray(new String[msbRemoteBusinessClasses.size()]);
  
              if (!setEquals(bmd.ivBusinessRemoteInterfaceClassNames, msbRemoteBusiness))
              {
                  errors.add(MERGE + "<business-remote> : " + Arrays.toString(msbRemoteBusiness) +
                             ", expected : " + Arrays.toString(bmd.ivBusinessRemoteInterfaceClassNames));
              }
  
              // Required : <local-bean> (if no-interface present)
              if (bmd.ivLocalBean != msb.isLocalBean())
              {
                  errors.add(MERGE + "<local-bean> : " + msb.isLocalBean() +
                             ", expected : " + bmd.ivLocalBean);
              }
  
              // Required : <session-type> (if not Stateless)
              int msbSessionType = msb.getSessionTypeValue();
              if ((bmd.type == InternalConstants.TYPE_STATELESS_SESSION &&
                  msbSessionType != Session.SESSION_TYPE_STATELESS) ||
                  (bmd.type == InternalConstants.TYPE_STATEFUL_SESSION &&
                  msbSessionType != Session.SESSION_TYPE_STATEFUL) ||
                  (bmd.type == InternalConstants.TYPE_SINGLETON_SESSION &&
                  msbSessionType != Session.SESSION_TYPE_SINGLETON))
              {
                  String msbTypeStr = msbSessionType == Session.SESSION_TYPE_UNSPECIFIED ? "unspecified" :
                                  msbSessionType == Session.SESSION_TYPE_SINGLETON ? "Singleton" :
                                                  msbSessionType == Session.SESSION_TYPE_STATEFUL ? "Stateful" :
                                                                  msbSessionType == Session.SESSION_TYPE_STATELESS ? "Stateless" :
                                                                                  "unknown";
                  String typeStr = bmd.isStatelessSessionBean() ? "Stateless" :
                                  bmd.isStatefulSessionBean() ? "Stateful" : "Singleton";
                  errors.add(MERGE + "<session-type> : " + msbTypeStr +
                             ", expected : " + typeStr);
              }
  
              // Required : <transaction-type> (if not default)
              int mTxType = msb.getTransactionTypeValue();
              if ((bmd.usesBeanManagedTx &&
                  mTxType != Session.TRANSACTION_TYPE_BEAN) ||
                  (!bmd.usesBeanManagedTx &&
                  mTxType != Session.TRANSACTION_TYPE_CONTAINER))
              {
                  String mTxStr = mTxType == Session.TRANSACTION_TYPE_UNSPECIFIED ? "unspecified" :
                                  mTxType == Session.TRANSACTION_TYPE_BEAN ? "Bean" :
                                                  mTxType == Session.TRANSACTION_TYPE_CONTAINER ? "Container" :
                                                                  "unknown";
                  String txStr = bmd.usesBeanManagedTx ? "Bean" : "Container";
                  errors.add(MERGE + "<transaction-type> : " + mTxStr +
                             ", expected : " + txStr);
              }
          }
  
          if (bmd.fullyInitialized &&
              meb instanceof ComponentViewableBean)
          {
              ComponentViewableBean cvb = (ComponentViewableBean) meb;
  
              // --------------------------------------------------------------------
              // Common processing for all bean types / completed BMD
              // --------------------------------------------------------------------
  
              // Optional : <remote> (may be derived from home.create, but will require)
              String mebRemoteName = cvb.getRemoteInterfaceName();
              String remoteName = (bmd.remoteInterfaceClass != null) ? bmd.remoteInterfaceClass.getName() : null;
              if (!equals(remoteName, mebRemoteName))
              {
                  errors.add(MERGE + "<remote> : " + mebRemoteName +
                             ", expected : " + remoteName);
              }
  
              // Optional : <local> (may be derived from localhome.create, but will require)
              String mebLocalName = cvb.getLocalInterfaceName();
              String localName = (bmd.localInterfaceClass != null) ? bmd.localInterfaceClass.getName() : null;
              if (!equals(localName, mebLocalName))
              {
                  errors.add(MERGE + "<local> : " + mebLocalName +
                             ", expected : " + localName);
              }
  
              // --------------------------------------------------------------------
              // Session Bean processing / completed BMD
              // --------------------------------------------------------------------
  
              if (msb != null)
              {
                  // Required : <stateful-timeout> (if not default)
                  if (bmd.sessionTimeout != msb.getStatefulTimeout().getTimeout())
                  {
                      errors.add(MERGE + "<session-timeout> : " + msb.getStatefulTimeout().getTimeout() +
                                 ", expected : " + bmd.sessionTimeout);
                  }
              }
  
          }
  
          logErrors(bmd.j2eeName, errors);
      }