revamped rules and added an XML document