def parse_nhx(NHX_string):
<EOL>ndict = {}<EOL>if "<STR_LIT>" in NHX_string:<EOL><INDENT>NHX_string = NHX_string.replace("<STR_LIT>", "<STR_LIT>")<EOL>NHX_string = NHX_string.replace("<STR_LIT:]>", "<STR_LIT>")<EOL>for field in NHX_string.split("<STR_LIT::>"):<EOL><INDENT>try:<EOL><INDENT>pname, pvalue = field.split("<STR_LIT:=>")<EOL>ndict[pname] = pvalue<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise NewickError('<STR_LIT>' % field)<EOL><DEDENT><DEDENT><DEDENT>return ndict<EOL>
NHX format:  [&&NHX:prop1=value1:prop2=value2] 
MB format: ((a[&Z=1,Y=2], b[&Z=1,Y=2]):1.0[&L=1,W=0], ...