Azure Function How To Return XML Not A String

I am trying to return a XML config file from an Azure Function. The config is being written into a string like below.

                    xml = @"<note>
                        <to>Tove</to>
                        <from>Jani</from>
                        <heading>Reminder</heading>
                        <body>Don't forget me this weekend!</body>
                        </note>";

I am then returning it like this

return req.CreateResponse(HttpStatusCode.OK, xml.Replace("\r\n",""));

However the result from the HTTP call is like this

    "
    <note>
        <to>Tove</to>
        <from>Jani</from>
        <heading>Reminder</heading>
        <body>Don't forget me this weekend!</body>
</note>"

How do I get rid of the enclosing quotation marks?

1 answer

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum