I am generating a UTF-8 XML using Spring Data REST. I am annotating the method which returns the XML as follows:
@RequestMapping(value = "/Something/{id:.+}",
method = RequestMethod.GET,
produces = "application/xml")
public @ResponseBody String metsResource(@PathVariable String id){...}
My program generates an XML with some data from various APIs. I am noticing in some of the APIs, the data has a copyright symbol. When I create my XML and check it out, it is generated fine But the browsers(tried with Chrome & Safari) cannot render the XML. I get the following error. When I copied the XML output form the console, I could see the error position was right near the copyright symbol. I am not sure what went wrong in my XML, when the input contains a copyright symbol. Could anyone suggest a fix?

--EDIT--
Here is a chunk of the XML. If you see inside the element accessCondition, you will notice a copyright symbol. This is exactly where the browser stops rendering.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<data>
<hdr CREATEDATE="2014-07-21T12:40:09"/>
<sec ID="123456">
<xmlData>
<titleInfo>
<title script="Latn">A book</title>
<subTitle>Indian stories</subTitle>
</titleInfo>
<name>
<namePart>Jane Doe</namePart>
<role>Creator</role>
</name>
<originInfo>
<publisher script="Latn"> ABCD Press</publisher>
<place> Connecticut</place>
<dateOther encoding="w3cdtf" keyDate="yes">2009</dateOther>
</originInfo>
<language>
<languageTerm type="code">eng</languageTerm>
<languageTerm type="text">English</languageTerm>
</language>
<abstract>A book with lot of Red Indian Stories.</abstract>
<identifier type="hdl">123456</identifier>
<location>
<physicalLocation>N7433.4 L44 A88 2009</physicalLocation>
</location>
<accessCondition type="rightsOwnership">© 2009 Jane Doe - ABCD Press, Connecticut</accessCondition>
<recordInfo>Test</recordInfo>
</xmlData>
</sec>
</data>
The codebase which generates the complete XML is huge, so its hard to show here. But just before returning the XML, the program converts the ByteArrayOutputStream (variable 'out' in this case) into UTF-8
String xml = out.toString("UTF-8");
Like Jim Garrison suggested in the comments it seems like the © symbol in the input came in as ISO-8859-1 encoding. Reason: when I changed the above conversion of the ByteArrayOutputStream as following, the XML started to show.
String xml = out.toString("ISO-8859-1");
Is there any way to get the output as UTF-8? Thank a lot!
0xa9) then it's ISO-8859-1. If it is two bytes (0xc2 0xa9) then it's UTF-8.