@SuppressWarnings("unchecked")
@Override
public <T> DataWriter<T> createWriter(Class<T> cls) {
if (cls == XMLStreamWriter.class) {
return (DataWriter<T>) new XMLStreamDataWriter();
} else if (cls == Node.class) {
return (DataWriter<T>) new NodeDataWriter();
} else {
throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
}