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().newDocument(); Element juur=d.createElement("linnad"); d.appendChild(juur); for(int i=0; i