implemented saving rectangle to the xml file