protected void adoptElement ( DomXmlElement elementToAdopt ) { Document document = this . domElement . getOwnerDocument ( ) ; Element element = elementToAdopt . domElement ; if ( ! document . equals ( element . getOwnerDocument ( ) ) ) { Node node = document . adoptNode ( element ) ; if ( node == null ) { throw LOG . unableToAdoptElement ( elementToAdopt ) ; } } }
Adopts an xml dom element to the owner document of this element if necessary .