added xml writer extension to ner.py, some tweaks