@ Nullable public static Document getOwnerDocument ( @ Nullable final Node aNode ) { if ( aNode == null ) return null ; if ( aNode instanceof Document ) return ( Document ) aNode ; return aNode . getOwnerDocument ( ) ; }
Get the owner document of the passed node . If the node itself is a document only a cast is performed .