'Make a data element for an edge or a node. Keep a log of the
type in the keys table.'

def add_data(self, name, element_type, value, scope='all', default=None):

    if (element_type not in self.xml_type):
        msg = 'GraphML    writer    does    not    support    %s    as    data    values.'
        raise nx.NetworkXError((msg % element_type))
    keyid = self.get_key(name, self.xml_type[element_type], scope, default)
    data_element = self.myElement('data', key=keyid)
    data_element.text = make_str(value)
    return data_element
