code: public void activateScope(QName targetUnit) {
  
          Scope nextScope = getScope(targetUnit);
          int parentScopeId = getParentScope(targetUnit).getId();
  
          Scope activeScope = activeChildMapping.get(parentScopeId);
          if(!nextScope.equals(activeScope))
          {
              //System.out.println("Replace activation of scope "+activeScope+" with "+ nextScope);
  
              // root element might not have an active scope
              if(activeScope!=null)
                  activeScope.setActive(false);
  
              nextScope.setActive(true);
              activeChildMapping.put(parentScopeId, nextScope);
  
          }
      }
docs: Deactivates a previously active sibling scope and activate a new one.
  (Only a single sibling scope can be active at a time)
  
  @param targetUnit the unit from which the scope will be derived