XML – Ancestor

XML family tree can understand better with some relations between elements hierarchy. We know that elements within the elements is the regular structure of XML which consists one root element for all.

Every inner element will have one or more outer elements which can be identified as Ancestors.

Please find the below example and identify the ancestors for element “city”.

Below figure shows the Ancestor elements of “city” 

XML ancestor element