now it prints xml in a separate function
writes response xml to buffer if an io.Writer is passed