Mozilla has a project called Rhino, it uses the JVM to interface to all of java libraries. I go over the perks and how to setup / deploy a Rhino application.
Firefox introduced a new aspect to file access from a website. You can now read data from files before its uploaded. I got over reading files and uploading them with true ajax.
Json might be lighter weight to transport but the downside in php is its parser isn't as quick as its xml. So I got over a simple example and load times