Added validation, but only for systems with the lxml module installed.