I am going to handle XML files for a project. I had earlier decided to use lxml but after reading the requirements, I think ElemenTree would be better for my purpose.
The XML files that have to be processed are:
Small in size. Typically < 10 KB.
No namespaces.
Simple XML structure.
Given the small XML size, memory is not an issue. My only concern is fast parsing.
What should I go with? Mostly I have seen people recommend lxml, but given my parsing requirements, do I really stand to benefit from it or would ElementTree serve my purpose better?
As others have pointed out, lxml implements the ElementTree API, so you're safe starting out with ElementTree and migrating to lxml if you need better performance or more advanced features.
The big advantage of using ElementTree, if it meets your needs, is that as of Python 2.5 it is part of the Python standard library, which cuts down on external dependencies and the (possible) headache of dealing with compiling/installing C modules.