The way you are doing it now, you are relying on the browser to do the transformation for you. If you don't have anything on your server side that can do
Java processing, then I think your only option is to produce three almost-identical versions of the XML file.
However if you have something at the server side that can dynamically insert that processing instruction, or that can actually do the transformation, then do that. But I won't get into explaining how unless there is a possibility the information might be useful.