fixed and simplyified xml attribute parsing