I have the following example.xml structure:
This is Sibling One A
Value of child one A
Value of child two A
This is a different value for Sibling one A
This is a different value for Child one A
This is a different value for Child Two A
A final value for Sibling one A
A final value for Child one A
A final value for Child one A
My main requirement is to loop through each one of the nodes and when the current node in question is "SiblingOneA", the code makes a check to see if the sibling node directly adjacent is "SiblingTwoA". If so, then it should retrieve all the children nodes (both the elements themselves, and the values within the elements).
So far, this is my code:
from lxml import etree
XMLDoc = etree.parse('example.xml')
rootXMLElement = XMLDoc.