in reply to printing xml declaration

If I use "\" in the code, will it take away the meaning of xml declaration and print xml declaration literally ?

That depends entirely on exactly what you mean. See How do I post a question effectively?