# XML etree not found

**URL:** <https://forum.inductiveautomation.com/t/xml-etree-not-found/75850>\
**Category:** Ignition\
**Created:** [July 3, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/xml-etree-not-found/75850 "2023-07-03T14:29:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jacob.ramirez](https://forum.inductiveautomation.com/u/jacob.ramirez)\
**Post date:** [July 3, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/xml-etree-not-found/75850/1 "2023-07-03T14:29:49Z")

</div>

Does anyone know why the XML etree module in the standard library would not be found when trying to import? At some point last night in my code of importing the etree module, it started throwing an error.

Can anyone speak to this? Any suggestions?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 3, 2023, 2:40pm UTC](https://forum.inductiveautomation.com/t/xml-etree-not-found/75850/2 "2023-07-03T14:40:59Z")

</div>

I never use it. A lot of people report problems. I recommend java's native XML.

See this older topic:

> [@XML Parsing Failing Every 10 Runs of Code](https://forum.inductiveautomation.com/t/xml-parsing-failing-every-10-runs-of-code/21838/3):
>
> Consider using the Java native XML handling, which yields an XML Document with standard DOM methods. [https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Document.html](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Document.html) You might find my [shared script module](https://www.automation-pros.com/ignition/xml.py) a start, used like so: dom = shared.xml.strToDoc(oxml)

And this more recent discussion:

> [@New conversion from python parsing to Java](https://forum.inductiveautomation.com/t/new-conversion-from-python-parsing-to-java/49202):
>
> Here is the current block of code where I am using the parse with jython solution that tends to lock up every so often. import xml.etree.ElementTree as ET #read the xml filef for device in importDevices: filePath = '%s/%s.xml' % (rootPath,device) #print 'reading %s' % filePath deviceStart = system.date.now() #logger.info('Before: tree = ET.parse(filePath)') tree = ET.parse(filePath) #logger.info('After: tree = ET.parse(filePath)') xmlFile = tree.getroot() I made the f…

---

<div class="post-metadata">

**Author:** ![jacob.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jacob.ramirez](https://forum.inductiveautomation.com/u/jacob.ramirez)\
**Post date:** [July 4, 2023, 2:28pm UTC](https://forum.inductiveautomation.com/t/xml-etree-not-found/75850/3 "2023-07-04T14:28:23Z")

</div>

If I print out the value from `dom = shared.xml.strToDoc(oxml)` should it return `[#document: null]` or should it print out the actual XML that I passed in?

---

<div class="post-metadata">

**Author:** ![jacob.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jacob.ramirez](https://forum.inductiveautomation.com/u/jacob.ramirez)\
**Post date:** [July 4, 2023, 8:02pm UTC](https://forum.inductiveautomation.com/t/xml-etree-not-found/75850/4 "2023-07-04T20:02:45Z")

</div>

Update: I have looked into your script more and found the correct functions to call on the returned object from your script. I have figured this out and this is working great. Thank you for your help.
