This method of the Element interface retrieves the parent of this element. Every element in the tree—except the Document itself—has a parent.
public Element getParent();
Returns the parent element or null if at the root of the tree.