Before saving the channel variable, serialize it (json object).
In your channel destination, write out the "book" variable.
So something like this:
In Transformer
var book=new Object();
book.title = msg['books']['book'][0]['title'].toString();
book.copies = msg['books']['book'][0]['NoOfCopies'].toString();
logger.info("book "+book);
var Jbook = JSON.stringify(book);
channelMap.put("Jbook",Jbook );
In Destination Template
${jbook}
Then on the receiving channel
var book = JSON.parse(msg.toString());
I have not verified this code, but it should give you a coding strategy.
See Mirth Discussion about JSON
Also: Please see our HealthcareIT project proposal at area51.StackExchange. This would be a good question to ask.