What App Server you using ? If you are using Websphere (possibly others, but I don't know) , you might have to set up a 'file url' and use JNDI to delegate the job of finding the directory to the App Server itself.
As an experiment to shed more light on the problem, you could try something like:
File nopath = new File("text.xml");
System.out.println(nopath.getCanonicalPath());
And:
File relpath = new File("../../jsp/text.xml");
System.out.println(relpath.getCanonicalPath());
I wonder if you are going to be able to do this...I have a feeling (and that's all it is , please check!) that App Server's Security manager might not like you trying to traverse up and out of the directory....
You might want to reconsider not creating a file-on-disk - instead create a new servlet that dynamically serves up the XML...(presuming that you need the client-browser to see some XML ultimately...).