Read XML string stored in block description

I’m developping a tool with Python which stores XML data in block description.
I know how to set or get a string in my block description but I am more confused with XML part (convert a string into a XML element in order to read or modify it).
Do you have any advice or example on the XML lib I could use and how to use it ?
I have tried the following :

import xml.etree.ElementTree as etree
import rhinoscriptsyntax as rs

blockId = rs.GetObject(“Block ?”,rs.filter.instance)
blockName = rs.BlockInstanceName(blockId)
blockDescription = rs.BlockDescription(blockName)

XMLDescription = etree.fromstring(blockDescription)

print XMLDescription

But I get this error message :
Message: No module named expat; use SimpleXMLTreeBuilder instead

Any thoughts ?
Thank you

Ok, after few file updating at random in my python lib, it finally works. ElementTree wasn’t probably up-to-date.

Hi BaptisteC,
I am using xlrd module to import data from an .xlsx file to rhinopython and I get the same error message.
Could you please tell me the version of ElementTree to update to? Did you update via cmd?
Thanks in advance.


I am running the 1.2.7 version of ElementTree.
I re-installed it and it worked correctly.