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