def decode(data):
dom = None<EOL>try:<EOL><INDENT>dom = dhtmlparser.parseString(data)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise MetaParsingException("<STR_LIT>" % e.message)<EOL><DEDENT>root = dom.find("<STR_LIT:root>")<EOL>if not root:<EOL><INDENT>raise MetaParsingException("<STR_LIT>")<EOL><DEDENT>if len(root) > <NUM_LIT:1>:<EOL><INDENT>raise MetaParsingException("<STR_LIT>")<EOL><DEDENT>items = root[<NUM_LIT:0>].find("<STR_LIT>")<EOL>if not items:<EOL><INDENT>raise MetaParsingException("<STR_LIT>")<EOL><DEDENT>decoded = []<EOL>for item in items:<EOL><INDENT>if "<STR_LIT:key>" not in item.params:<EOL><INDENT>raise MetaParsingException(<EOL>"<STR_LIT>" % str(item)<EOL>)<EOL><DEDENT>decoded.append([<EOL>item.params["<STR_LIT:key>"],<EOL>item.getContent().strip()<EOL>])<EOL><DEDENT>decoded = validator.check_structure(decoded)<EOL>return decoded<EOL>
Handles decoding of the XML `data`.

Args:
    data (str): Data which will be decoded.

Returns:
    dict: Dictionary with decoded data.