Consolidated into one function Fixxml
deleted unused imports