generalized XML code and updated broken Div AA code