public static Element extractElement(Document document, Element element) throws MalformedElementException {
    """
	Clones the given element, and its subtrees, and sets it as the root
	of the given document. Returns the cloned element. The document must
	not have a root and must not be <code>null</code>. The element must
	not be <code>null</code>.
	
	@param document the document that will become the owner and parent
	of the cloned element
	@param element  the element to be cloned
	@returns        a clone of the element
	@throws         MalformedElementException if an element exists in the
	subtree to be cloned whose namespace can't be
	resolved
    """
        Assert.isNotNull(document);
        Assert.isTrue(document.getDocumentElement() == null);
        Assert.isNotNull(element);
        return (Element) extractNode(document, element);
    }
public static Element extractElement(Document document, Element element) throws MalformedElementException {
        Assert.isNotNull(document);
        Assert.isTrue(document.getDocumentElement() == null);
        Assert.isNotNull(element);
        return (Element) extractNode(document, element);
    }
public static Element extractElement ( Document document , Element element ) throws MalformedElementException { Assert . isNotNull ( document ) ; Assert . isTrue ( document . getDocumentElement ( ) == null ) ; Assert . isNotNull ( element ) ; return ( Element ) extractNode ( document , element ) ; }
Clones the given element, and its subtrees, and sets it as the root
of the given document. Returns the cloned element. The document must
not have a root and must not be <code>null</code>. The element must
not be <code>null</code>.

@param document the document that will become the owner and parent
of the cloned element
@param element  the element to be cloned
@returns        a clone of the element
@throws         MalformedElementException if an element exists in the
subtree to be cloned whose namespace can't be
resolved
Clones the given element and its subtrees and sets it as the root of the given document . Returns the cloned element . The document must not have a root and must not be <code > null< / code > . The element must not be <code > null< / code > .