case XMLStreamConstants.COMMENT:
element.addContent(new Comment(currentEvent.asCharacters().getData()));
break;
case XMLStreamConstants.ENTITY_REFERENCE:
EntityReference er = (EntityReference)currentEvent;
element.addContent(new EntityRef(er.getName(), er.getDeclaration().getPublicId(), er.getDeclaration().getSystemId()));
break;
case XMLStreamConstants.PROCESSING_INSTRUCTION:
javax.xml.stream.events.ProcessingInstruction pi = (javax.xml.stream.events.ProcessingInstruction)currentEvent;
element.addContent(new ProcessingInstruction(pi.getTarget(), pi.getData()));