'Automatically set the node\'s xsi:type attribute based on either I{value}\'s
class or the class of the node\'s text.  When I{value} is an unmapped class,
the default type (xs:any) is set.
@param node: An XML node
@type node: L{sax.element.Element}
@param value: An object that is or would be the node\'s text.
@type value: I{any}
@return: The specified node.
@rtype: L{sax.element.Element}'

@classmethod
def auto(cls, node, value=None):

    if (value is None):
        value = node.getText()
    if isinstance(value, Object):
        known = cls.known(value)
        if (known.name is None):
            return node
        tm = (known.name, known.namespace())
    else:
        tm = cls.types.get(value.__class__, cls.types.get(str))
    cls.manual(node, *tm)
    return node
