Refactor: lrmd: functionize creating reply
reduces duplication, and enforces consistency in reply XML and logging