extracted some methods and brought in an XML helper