'Convert list, tuple, dict to NaElement and appends.
Example usage:
1.
.. code-block:: xml
<root>
<elem1>vl1</elem1>
<elem2>vl2</elem2>
<elem3>vl3</elem3>
</root>
The above can be achieved by doing
.. code-block:: python
root = NaElement(\'root\')
root.translate_struct({\'elem1\': \'vl1\', \'elem2\': \'vl2\',
\'elem3\': \'vl3\'})
2.
.. code-block:: xml
<root>
<elem1>vl1</elem1>
<elem2>vl2</elem2>
<elem1>vl3</elem1>
</root>
The above can be achieved by doing
.. code-block:: python
root = NaElement(\'root\')
root.translate_struct([{\'elem1\': \'vl1\', \'elem2\': \'vl2\'},
{\'elem1\': \'vl3\'}])'

def translate_struct(self, data_struct):

    if isinstance(data_struct, (list, tuple)):
        for el in data_struct:
            if isinstance(el, (list, tuple, dict)):
                self.translate_struct(el)
            else:
                self.add_child_elem(NaElement(el))
    elif isinstance(data_struct, dict):
        for k in data_struct.keys():
            child = NaElement(k)
            if isinstance(data_struct[k], (dict, list, tuple)):
                child.translate_struct(data_struct[k])
            elif data_struct[k]:
                child.set_content(six.text_type(data_struct[k]))
            self.add_child_elem(child)
    else:
        raise ValueError(_('Type    cannot    be    converted    into    NaElement.'))
