[PATCH] XmlPreprocessor: Modify template detection