import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*; public class UusDokument{ public static void main(String argumendid[]) throws Exception{ String[] linnanimed={"Tallinn", "Tartu", "Narva"}; Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("linnad.xml"); // Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); // Element juur=d.createElement("linnad"); // d.appendChild(juur); Element juur=(Element)d.getElementsByTagName("linnad").item(0); for(int i=0; i