*/
public static void adoptElement(Element adoptee, Document adopter) {
if (!(adoptee.getOwnerDocument().equals(adopter))) {
if (adopter.adoptNode(adoptee) == null) {
// This can happen if the adopter and adoptee were produced by different DOM implementations
throw new XMLRuntimeException("DOM Element node adoption failed");
}
}
}