This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The backslash \ character in string literals is the escape character. It allows you to write for example \n for a newline, \t for a tab etc.
If you write "C:\Documents and Settings\JA0084604\Desktop\test1a.xml" then Java is going to complain that \D and \J are illegal escape sequences. If you want to include a literal backslash in your string, you have to write \\ (two backslashes).
So, change the string to: "C:\\Documents and Settings\\JA0084604\\Desktop\\test1a.xml"
I added code tags to your post to make it more legible. Next time, just highlight your code and click the little "code" button above - just like you wanted to make something italic or bold (but don't make your code italic or bold...)
To answer your question...
You declare your XMLDocument inside your try block. therefore, as soon as you go out of the try block the document falls out of scope, and thus doesn't exist anymore. The solution would be to declare them outside the try block, but still assign them inside...something like this:
Note: I didn't actually test/compile this, so i'm not 100% sure i have it correct...
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors