'get XML attValues for an element (Node or Edge) by passing an attribute values list (stored in Nodes and Edges)'

@staticmethod
def getAttributesXML(atts):

    if (len(atts) > 0):
        attValuesXML = etree.Element('attvalues')
        for att in atts:
            attValueXML = etree.SubElement(attValuesXML, 'attvalue')
            attValueXML.set('for', str(att['id']))
            attValueXML.set('value', att['value'])
            if (('start' in att.keys()) and (not (att['start'] == ''))):
                attValueXML.set(('start' if ((not ('startopen' in att.keys())) or (not att['startopen'])) else 'startopen'), att['start'])
            if (('end' in att.keys()) and (not (att['end'] == ''))):
                attValueXML.set(('end' if ((not ('endopen' in att.keys())) or (not att['endopen'])) else 'endopen'), att['end'])
        return attValuesXML
    else:
        return None
