item = new Element(item);
// add copy of content to wrapper:
if (node instanceof Attribute) {
Attribute attr = (Attribute) node;
item.addAttribute((Attribute) attr.copy());
} else if (node instanceof Document) {
Document doc = (Document) node;
for (int j=0; j < doc.getChildCount(); j++) {
item.appendChild(doc.getChild(j).copy());
}