xmlTemplate and doc improvements