I am new to python and xml parsing, so this may be a very dumb question. What is the best way to test if a given element if it is the root if the root is not known? So for example, given a generic test.xml structure;
<root>
<child1>
<child2>
<child3>Some Text</child3>
Run Code Online (Sandbox Code Playgroud)
And you have a function that takes in elements only. The only way I have come up so far is something like this, but requires the root to be …