Would you use...
Option 1)
Create object with field which contains xml. Transform object to json using json library and let the library do the escaping.
Option 2)
Base64 encode xml and put base64 encoded string inside json.
Option 3)
Something else?
Create object with field which contains xml. Transform object to json using json library and let the library do the escaping.
Yes. That is how you create JSON. (The other approach is to mash strings together, which is error prone).
Base64 encode xml and put base64 encoded string inside json.
No. XML is just text. There is no point in Base64 encoding it.