public void store(Element root){
  Element values;
  List<String> names=getConsistNameList();
  if (Control.backwardCompatible) {
    root.addContent(values=new Element(Xml.CONSISTS));
    for (    String name : names) {
      String consistNames=name + "%%";
      values.addContent(consistNames);
    }
  }
  Element consists=new Element(Xml.NEW_CONSISTS);
  for (  String name : names) {
    Element consist=new Element(Xml.CONSIST);
    consist.setAttribute(new Attribute(Xml.NAME,name));
    consists.addContent(consist);
  }
  root.addContent(consists);
  root.addContent(values=new Element(Xml.ENGINES));
  for (  RollingStock rs : getByRoadNameList()) {
    Engine eng=(Engine)rs;
    values.addContent(eng.store());
  }
}

public void store ( Element root ) { Element values ; List < String > names = getConsistNameList ( ) ; if ( Control . backwardCompatible ) { root . addContent ( values = new Element ( Xml . CONSISTS ) ) ; for ( String name : names ) { String consistNames = name + "%%" ; values . addContent ( consistNames ) ; } } Element consists = new Element ( Xml . NEW_CONSISTS ) ; for ( String name : names ) { Element consist = new Element ( Xml . CONSIST ) ; consist . setAttribute ( new Attribute ( Xml . NAME , name ) ) ; consists . addContent ( consist ) ; } root . addContent ( consists ) ; root . addContent ( values = new Element ( Xml . ENGINES ) ) ; for ( RollingStock rs : getByRoadNameList ( ) ) { Engine eng = ( Engine ) rs ; values . addContent ( eng . store ( ) ) ; } }
create an xml element to represent this entry . this member has to remain synchronized with the detailed dtd in operations - engines . dtd .
