def _XMLDumpList (self, list_name, l, indent, was_array_typecode=None) :
    # This strange business is to handle lists with no names:
    # either nested within other lists or at the top-level so it will
    # still form well-formed XML: this is pretty rare, but we should
    # still do something useful.
    if list_name is self.NULLKey_ :
        tag = "list__"
    else :
        tag = list_name

    # Empty list
    if len(l)==0 :   # Force list type__ so will unXMLize as an Arr()
        self._XMLDumpPrimitive(tag, None, indent, self.LISTAttrs_)
        return

    # Non-empty list
    for ii in xrange(0, len(l)) :
        key_to_use = self.NULLKey_   # normally NULL RARELY: empty list
        value_ptr = l[ii]
      
        # This strange bit is because a table is directly inside a 
        # list, which means there IS no tag, which normally would be
        # an extra indent with an empty name: this is specifically because
        # of the dict within a list.  A table inside can also mean
        # the __contents__
        table_inside_value = type(value_ptr)==dict or type(value_ptr)==OrderedDict
        indent_inc = self.indentIncrement_
        attrs = { }
        if (table_inside_value) :
            indent_inc = 0
            attrs = self._FindAttributes(value_ptr)
            # Special rare case: contents in special key
            if (value_ptr in "__content__") :
                value_ptr = value_ptr["__content__"]

            if (type(value_ptr)==dict or type(value_ptr)==OrderedDict) and len(value_ptr)==0 and len(l)==1 :
                # This RARE situation:  
                # { 'top': [ {} ] } -> <top type__="list"> <dict__/> </top>
                # Empty table inside a list: Ugh: hard to express in XML
                # without a new tag ... it's basically an anonymous table:
                # Normally, it's easy to detect a table, but an empty
                # dict inside a list is a special case
                indent_inc = self.indentIncrement_
                key_to_use = self.DICTTag_
	
	
        elif type(value_ptr) in array_types and \
             self.arrDisp_ != ARRAYDISPOSITION_AS_LIST :
	    #### Array data, well has peculilarities: let it handle it
            self._XMLDumpPODList(tag, value_ptr, indent, ii, 
                                 (ii==0 and len(l)==1))
            continue
      
        # If list of 1, preserve listness by adding type field
        if (ii==0 and len(l)==1) :
            attrs["type__"]="list"
      
        primitive_type = not self._IsComposite(value_ptr)
        self._XMLDumpStartTag(tag, attrs, indent, primitive_type, False,
                              was_array_typecode)
        self._XMLDumpKeyValue(key_to_use, value_ptr, indent+indent_inc, None, 
                              was_array_typecode)
        self._XMLDumpEndTag(tag, indent, primitive_type)
    
        
  # Dump a list of binary data as a tag with one special key:
  # arraytype__ = "<typetag>" which is some typetag (silxfdSILXFD)
  # or, every individual element as a "type__" = <typetag>"
dataset/ETHPy150Open redhat-imaging/imagefactory/imgfac/picklingtools/xmldumper.py/XMLDumper._XMLDumpList/swapped operands of `in`