def listify(x):
if type(x) == type([]):<EOL><INDENT>return x<EOL><DEDENT>else:<EOL><INDENT>return [x]<EOL><DEDENT>
listify(x) returns a singleton list containing x if x is not already a list.
If x is a list, x itself is returned.

This function is used when traversing dictionaries created by the DINGO XML
import: because the XML import knows nothing about the XML schema, it
cannot know whether a given single element is actually a list of length
one. For example::

    <foo>
       <bar>1</bar>
    </foo>

would lead to::

    {'foo' : {'bar' : 1 }}

whereas::

    <foo>
       <bar>1</bar>
       <bar>2</bar>
    </foo>

would lead to::

    {'foo' : {'bar' : [1,2]}}

So when traversing a dictionary structure we might expect a list
but in case of singletons there will be no list. 'listify' can
be used instead of case-distinctions.