'Represent the element in an import item for dataTable display
@param value: the string containing the element'

def _item_element_represent(self, id, value):

    try:
        element = etree.fromstring(value)
    except:
        return DIV(value)
    db = current.db
    tablename = element.get('name')
    table = db[tablename]
    output = DIV()
    details = TABLE(_class=('importItem    %s' % id))
    (header, rows) = self._add_item_details(element.findall('data'), table)
    if (header is not None):
        output.append(header)
    components = element.findall('resource')
    s3db = current.s3db
    for component in components:
        ctablename = component.get('name')
        ctable = s3db.table(ctablename)
        if (not ctable):
            continue
        self._add_item_details(component.findall('data'), ctable, details=rows, prefix=True)
    if rows:
        details.append(TBODY(rows))
    errors = current.xml.collect_errors(element)
    if errors:
        details.append(TFOOT(TR(TH(('%s:' % current.T('Errors'))), TD(UL([LI(e) for e in errors])))))
    if ((rows == []) and (components == [])):
        refdetail = TABLE(_class=('importItem    %s' % id))
        references = element.findall('reference')
        for reference in references:
            tuid = reference.get('tuid')
            resource = reference.get('resource')
            refdetail.append(TR(TD(resource), TD(tuid)))
        output.append(refdetail)
    else:
        output.append(details)
    return str(output)
