Element clonedElmt = (Element) parentElmt.cloneNode(true);
children = clonedElmt.getChildNodes();
Node refChild = (position <= children.getLength()) ? children.item(position - 1) : null;
Document clonedDocument = clonedElmt.getOwnerDocument();
for (int i = 0; i < siblingNodes.size(); i++) {
clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
}
return clonedElmt;
}
}