def _parse_string(self, xml):
if not isinstance(xml, HTMLElement):<EOL><INDENT>xml = dhtmlparser.parseString(str(xml))<EOL><DEDENT>record = xml.find("<STR_LIT>")<EOL>if not record:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>record = record[<NUM_LIT:0>]<EOL>self.oai_marc = len(record.find("<STR_LIT>")) > <NUM_LIT:0><EOL>if not self.oai_marc:<EOL><INDENT>leader = record.find("<STR_LIT>")<EOL>if len(leader) >= <NUM_LIT:1>:<EOL><INDENT>self.leader = leader[<NUM_LIT:0>].getContent()<EOL><DEDENT><DEDENT>if self.oai_marc:<EOL><INDENT>self._parse_control_fields(record.find("<STR_LIT>"), "<STR_LIT:id>")<EOL>self._parse_data_fields(record.find("<STR_LIT>"), "<STR_LIT:id>", "<STR_LIT:label>")<EOL><DEDENT>else:<EOL><INDENT>self._parse_control_fields(record.find("<STR_LIT>"), "<STR_LIT>")<EOL>self._parse_data_fields(record.find("<STR_LIT>"), "<STR_LIT>", "<STR_LIT:code>")<EOL><DEDENT>if self.oai_marc and "<STR_LIT>" in self.controlfields:<EOL><INDENT>self.leader = self.controlfields["<STR_LIT>"]<EOL><DEDENT>
Parse MARC XML document to dicts, which are contained in
self.controlfields and self.datafields.

Args:
    xml (str or HTMLElement): input data

Also detect if this is oai marc format or not (see elf.oai_marc).