rewrite: ensure lxml parser closes gracefully on no input