unescape xml entities and allow custom directory