SELECT CONCAT('\n', CONCAT('\n\t', GROUP_CONCAT('\n\t\t' SEPARATOR ''),'\n\t'),'\n') AS xmldoc FROM product;