implementing XML method