@classmethod
def parse(cls, data):
    """
        Parses a XML String/Fileobject into a Record tree

        :param data: a XML string or fileobject
        :returns: a Record tree

        >>> from wcf.records import dump_records, print_records
        >>> from wcf.xml2records import XMLParser
        >>> r = XMLParser.parse('<s:Envelope><b:Body /></s:Envelope>')
        >>> dump_records(r)
        b'V\\x02E\\x0e\\x01\\x01'
        >>> b = print_records(r)
        <s:Envelope>
         <b:Body></b:Body>
        </s:Envelope>
        """
    p = cls()
    xml = None
    if isinstance(data, str):
        xml = data
    elif hasattr(data, 'read'):
        xml = data.read()
    else:
        raise ValueError('%s has an incompatible type %s' % (data, type(data)))
    p.feed(xml)
    return p.records
