bug fixes in xml attribute handling and xpath