completed porting XML generator