title: How to create a XML template?
body: <p>i have 2 Python scripts that write to a same XML file. i'm using Python2.5 and WinXP.
  How can I create a template so that the XML file isn't overwritten when I run another Python script. It will only updates the section in the XML with value. For eg:XML template as below:</p>
  
  <pre><code>&lt;Test&gt;
   &lt;Default&gt;
     &lt;Value&gt;1&lt;/Value&gt; 
     &lt;Link_Status&gt;0&lt;/Link_Status&gt; 
     &lt;Lane_Status&gt;1&lt;/Lane_Status&gt; 
   &lt;/Default&gt;
   &lt;Settings&gt;
    &lt;Point&gt;4&lt;/Point&gt; 
    &lt;Delay&gt;1&lt;/Delay&gt; 
   &lt;/Settings&gt;
  &lt;/Test&gt;
  </code></pre>
  
  <p>i want default.py to update to the Default section and Settings.py to update the Settings section. appreciate your advice. tq</p>
  
  <p>Default.py code:</p>
  
  <pre><code>import elementtree.ElementTree as ET 
  
  root=ET.Element("Test")
  head1=ET.SubElement(root,"Default")
  title=ET.SubElement(head1,"Value")
  title.text="1"
  
  title=ET.SubElement(head1,"Link_Status")
  title.text="0"
  
  title=ET.SubElement(head1,"Lane_Status")
  title.text="1"
  
  tree=ET.ElementTree(root)
  tree.write("C:\Python25\myscript\cmm\\config.xml")
  </code></pre>
  
  <p>Settings.py code:</p>
  
  <pre><code>import elementtree.ElementTree as ET
  
  root=ET.Element("Test")
  head2=ET.SubElement(root,"Settings")
  title=ET.SubElement(head2,"Point")
  title.text=("4")
  
  title=ET.SubElement(head2,"Delay")
  title.text=("1")
  
  tree=ET.ElementTree(root)
  tree.write("C:\Python25\myscript\cmm\\config.xml")
  </code></pre>