public void translate(Writer writer) throws TransformerException,
IOException {
try {
XMLOutputFactory factory = getOutputFactory();
XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
for (Evaluator.NameValuePair nameValuePair : values) {
if (nameValuePair.value == null) {
continue;
}
addElement(nameValuePair.name, writer, eventWriter, eventFactory, namespaces, null, Collections.singletonList(nameValuePair.value));