/**
   * Writes the contents of this object to a file in a xml format.
   *
   * @param h A helper object for storing.
   */
  public void XwriteObject(XMLHelper h) {
    h.openNewElem("CriticalPairs", this);
    h.addObject("GraGra", getGrammar(), true);
    h.openSubTag("dependenciesContainer");

    String kind = "trigger_dependency";
    if (this.switchDependency) kind = "trigger_switch_dependency";
    h.addAttr("kind", kind);

    // Inhalt von excludeContainer schreiben (save)
    for (Enumeration<Rule> keys = this.excludeContainer.keys(); keys.hasMoreElements(); ) {
      Rule r1 = keys.nextElement();
      h.openSubTag("Rule");
      h.addObject("R1", r1, false);

      Hashtable<
              Rule,
              Pair<
                  Boolean,
                  Vector<
                      Pair<
                          Pair<OrdinaryMorphism, OrdinaryMorphism>,
                          Pair<OrdinaryMorphism, OrdinaryMorphism>>>>>
          secondPart = this.excludeContainer.get(r1);
      for (Enumeration<Rule> k2 = secondPart.keys(); k2.hasMoreElements(); ) {
        Rule r2 = k2.nextElement();
        h.openSubTag("Rule");
        h.addObject("R2", r2, false);
        Pair<
                Boolean,
                Vector<
                    Pair<
                        Pair<OrdinaryMorphism, OrdinaryMorphism>,
                        Pair<OrdinaryMorphism, OrdinaryMorphism>>>>
            p = secondPart.get(r2);
        Boolean b = p.first;
        h.addAttr("bool", b.toString());
        if (b.booleanValue()) {
          Vector<
                  Pair<
                      Pair<OrdinaryMorphism, OrdinaryMorphism>,
                      Pair<OrdinaryMorphism, OrdinaryMorphism>>>
              v = p.second;
          for (int i = 0; i < v.size(); i++) {
            Pair<Pair<OrdinaryMorphism, OrdinaryMorphism>, Pair<OrdinaryMorphism, OrdinaryMorphism>>
                p2i = v.elementAt(i);
            Pair<OrdinaryMorphism, OrdinaryMorphism> p2 = p2i.first;
            h.openSubTag("Overlapping_Pair");
            OrdinaryMorphism first = p2.first;
            Graph overlapping = first.getImage();
            /*
             * durch das true macht der String am Anfang keinen Sinn
             */
            h.addObject("", overlapping, true);

            Iterator<?> e = overlapping.getNodesSet().iterator();
            while (e.hasNext()) {
              GraphObject o = (GraphObject) e.next();
              if (o.isCritical()) {
                h.openSubTag("Critical");
                h.addObject("object", o, false);
                h.close();
              }
            }
            e = overlapping.getArcsSet().iterator();
            while (e.hasNext()) {
              GraphObject o = (GraphObject) e.next();
              if (o.isCritical()) {
                h.openSubTag("Critical");
                h.addObject("object", o, false);
                h.close();
              }
            }

            /*
             * first.writeMorphism(h);
             * ((OrdinaryMorphism)p2.second).writeMorphism(h);
             */

            writeOverlapMorphisms(h, r1, r2, p2i);

            h.close();
          }
        }
        h.close();
      }

      h.close();
    }
    h.close();
    h.openSubTag("conflictFreeContainer");
    for (Enumeration<Rule> keys = this.excludeContainer.keys(); keys.hasMoreElements(); ) {
      Rule r1 = keys.nextElement();
      h.openSubTag("Rule");
      h.addObject("R1", r1, false);

      Hashtable<
              Rule,
              Pair<
                  Boolean,
                  Vector<
                      Pair<
                          Pair<OrdinaryMorphism, OrdinaryMorphism>,
                          Pair<OrdinaryMorphism, OrdinaryMorphism>>>>>
          secondPart = this.conflictFreeContainer.get(r1);
      for (Enumeration<Rule> k2 = secondPart.keys(); k2.hasMoreElements(); ) {
        Rule r2 = k2.nextElement();
        h.openSubTag("Rule");
        h.addObject("R2", r2, false);
        Boolean b = secondPart.get(r2).first;
        h.addAttr("bool", b.toString());
        h.close();
      }

      h.close();
    }
    h.close();
    h.close();
  }