title: Add start and end attribute to node and edge in gexf file
body: <p>I have a <code>.gexf</code> file that contains nodes and edges with IDs and labels. I generated this <code>.gexf</code>file from a <code>.gml</code> file using <code>networkx</code>. Here's the code for that: </p>
  
  <pre><code>import networkx as nx
  
  G = nx.read_gml('data/gml/test.gml') # read in gml file as Graph
  nx.write_gexf(G, "output/test.gexf") # write to gexf format
  </code></pre>
  
  <p>The next thing I want to do, is to add a <code>start</code>and <code>end</code> attribute to every node and every edge in my file. </p>
  
  <p><strong>So basically, I want this</strong>:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;gexf version="1.1" xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gexf.net/1.1draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;graph defaultedgetype="undirected" mode="static"&gt;
      &lt;nodes&gt;
        &lt;node id="clock" label="clock" /&gt;
        &lt;node id="beach" label="beach" /&gt;
        &lt;node id="sun" label="sun" /&gt;
        &lt;node id="sea" label="sea" /&gt;
        &lt;node id="sand" label="sand" /&gt;
        &lt;node id="guitar" label="guitar" /&gt;
        (...)
      &lt;/nodes&gt;
      &lt;edges&gt;
        &lt;edge id="0" source="ice" target="shoe" weight="0.9995600294856769" /&gt;
        &lt;edge id="1" source="ice" target="toothbrush" weight="0.9992457544219484" /&gt;
        &lt;edge id="1533" source="snake" target="ant" weight="0.9999144063155566" /&gt;
        (...)
        &lt;edge id="1534" source="mosquito" target="jellyfish" weight="0.9994175606336606" /&gt;
        &lt;edge id="1535" source="ant" target="star" weight="0.9994226236705537" /&gt;
      &lt;/edges&gt;
    &lt;/graph&gt;
  &lt;/gexf&gt;
  </code></pre>
  
  <p><strong>to look like this</strong> (note the <code>dynamic</code>mode and <code>start</code> and <code>end</code> attributes):</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;gexf version="1.1" xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gexf.net/1.1draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;graph defaultedgetype="undirected" mode="dynamic"&gt;
      &lt;nodes&gt;
        &lt;node id="clock" label="clock" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;node id="beach" label="beach" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;node id="sun" label="sun" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;node id="sea" label="sea" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;node id="sand" label="sand" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;node id="guitar" label="guitar" start="2000-02-20" end="2000-02-22" /&gt;
        (...)
      &lt;/nodes&gt;
      &lt;edges&gt;
        &lt;edge id="0" source="ice" target="shoe" weight="0.9995600294856769" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;edge id="1" source="ice" target="toothbrush" weight="0.9992457544219484" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;edge id="1533" source="snake" target="ant" weight="0.9999144063155566" start="2000-02-20" end="2000-02-22" /&gt;
        (...)
        &lt;edge id="1534" source="mosquito" target="jellyfish" weight="0.9994175606336606" start="2000-02-20" end="2000-02-22" /&gt;
        &lt;edge id="1535" source="ant" target="star" weight="0.9994226236705537" start="2000-02-20" end="2000-02-22" /&gt;
      &lt;/edges&gt;
    &lt;/graph&gt;
  &lt;/gexf&gt;
  </code></pre>
  
  <p>Unfortunately I was not able to find any documentation (neither for <code>networkx</code> nor for <code>pygexf</code>) on how to write a dyamic <code>gexf</code> file and add a <code>start</code>and <code>end</code> attribute to every (already existing) node and edge. Can anyone please help me with this?</p>
  
  <p><strong>UPDATE</strong>: 
  When I use</p>
  
  <pre><code>nx.set_edge_attributes(G, 'start', '2000-02-20')
  nx.set_edge_attributes(G, 'end', '2000-02-22')
  </code></pre>
  
  <p>To set the edge attributes, I get the correct output, e.g.:</p>
  
  <pre><code>&lt;edge id="0" source="great" target="wait" weight="0.998675772419067" start="2000-02-20" end="2000-02-22" /&gt;
  </code></pre>
  
  <p>However, when I do:</p>
  
  <pre><code>nx.set_node_attributes(G, 'start','2000-02-20')
  nx.set_node_attributes(G, 'end','2000-02-22')
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>&lt;node id="blue" label="blue"&gt;
      &lt;attvalues&gt;
        &lt;attvalue for="0" value="2000-02-20" /&gt;
        &lt;attvalue for="1" value="2000-02-22" /&gt;
      &lt;/attvalues&gt;
  </code></pre>
  
  <p>How can I set the <code>start</code> and <code>end</code>attribute <em>within</em> the <code>node</code> tag?</p>