mySimBioModulesNode.appendChild(mySimWasteNode);
mySimBioModulesNode.appendChild(mySimWaterNode);
    private void initializeXML()            throws IOException, TransformerConfigurationException,            ParserConfigurationException {        //initialize factory        TransformerFactory transformerFactory = TransformerFactory                .newInstance();        transformerFactory.setAttribute("indent-number", new Integer(4));        myTransformer = transformerFactory.newTransformer();        myTransformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");        myTransformer.setOutputProperty(OutputKeys.METHOD, "xml");        myTransformer.setOutputProperty(OutputKeys.INDENT, "yes");        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();        DocumentBuilder builder = factory.newDocumentBuilder();        myXMLDocument = builder.newDocument();        //create root element        Element biosimElement = (Element) myXMLDocument.createElement("biosim");        biosimElement.setAttribute("xmlns:xsi",                XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);        biosimElement.setAttribute("xsi:noNamespaceSchemaLocation",                "BiosimInitSchema.xsd");        myXMLDocument.appendChild(biosimElement);        myBiosimNode = (Node) biosimElement;                //create globals        Node globalElement = myXMLDocument.createElement("Globals");        myBiosimNode.appendChild(globalElement);        //create comment        Node authorElement = myXMLDocument.createElement("author");        globalElement.appendChild(authorElement);        String date = DateFormat.getDateTimeInstance().format(new Date());        Node authorText = myXMLDocument                .createTextNode("Generated by BioSim Editor on " + date);        authorElement.appendChild(authorText);                mySimBioModulesNode = myXMLDocument.createElement("SimBioModules");        mySimAirNode = myXMLDocument.createElement("air");        mySimBioModulesNode.appendChild(mySimAirNode);        mySimCrewNode = myXMLDocument.createElement("crew");        mySimBioModulesNode.appendChild(mySimCrewNode);        mySimEnvironmentNode = myXMLDocument.createElement("environment");        mySimBioModulesNode.appendChild(mySimEnvironmentNode);        mySimFoodNode = myXMLDocument.createElement("food");        mySimBioModulesNode.appendChild(mySimFoodNode);        mySimFrameworkNode = myXMLDocument.createElement("framework");        mySimBioModulesNode.appendChild(mySimFoodNode);        mySimPowerNode = myXMLDocument.createElement("power");        mySimBioModulesNode.appendChild(mySimPowerNode);        mySimWasteNode = myXMLDocument.createElement("waste");        mySimBioModulesNode.appendChild(mySimWasteNode);        mySimWaterNode = myXMLDocument.createElement("water");        mySimBioModulesNode.appendChild(mySimWasteNode);        myBiosimNode.appendChild(mySimBioModulesNode);                mySensorNode = myXMLDocument.createElement("Sensors");        mySensorAirNode = myXMLDocument.createElement("air");        mySensorNode.appendChild(mySensorAirNode);        mySensorCrewNode = myXMLDocument.createElement("crew");        mySensorNode.appendChild(mySensorCrewNode);        mySensorEnvironmentNode = myXMLDocument.createElement("environment");        mySensorNode.appendChild(mySensorEnvironmentNode);        mySensorFoodNode = myXMLDocument.createElement("food");        mySensorNode.appendChild(mySensorFoodNode);        mySensorFrameworkNode = myXMLDocument.createElement("framework");        mySensorNode.appendChild(mySensorFoodNode);        mySensorPowerNode = myXMLDocument.createElement("power");        mySensorNode.appendChild(mySensorPowerNode);        mySensorWasteNode = myXMLDocument.createElement("waste");        mySensorNode.appendChild(mySensorWasteNode);        mySensorWaterNode = myXMLDocument.createElement("water");        mySensorNode.appendChild(mySensorWasteNode);        myBiosimNode.appendChild(mySensorNode);                myActuatorNode = myXMLDocument.createElement("Actuators");        myActuatorAirNode = myXMLDocument.createElement("air");        myActuatorNode.appendChild(myActuatorAirNode);        myActuatorCrewNode = myXMLDocument.createElement("crew");        myActuatorNode.appendChild(myActuatorCrewNode);        myActuatorEnvironmentNode = myXMLDocument.createElement("environment");        myActuatorNode.appendChild(myActuatorEnvironmentNode);        myActuatorFoodNode = myXMLDocument.createElement("food");        myActuatorNode.appendChild(myActuatorFoodNode);        myActuatorFrameworkNode = myXMLDocument.createElement("framework");        myActuatorNode.appendChild(myActuatorFoodNode);        myActuatorPowerNode = myXMLDocument.createElement("power");        myActuatorNode.appendChild(myActuatorPowerNode);        myActuatorWasteNode = myXMLDocument.createElement("waste");        myActuatorNode.appendChild(myActuatorWasteNode);        myActuatorWaterNode = myXMLDocument.createElement("water");        myActuatorNode.appendChild(myActuatorWasteNode);        myBiosimNode.appendChild(myActuatorNode);    }