China Naming Network - Company naming - Real-time weather forecast interface
Real-time weather forecast interface
Simple method, you can directly build this xml in doGet or doPost of servlet, and then write back the response.
You need to build a java application server, such as tomcat server, and just run this servlet.
There are many tools to build xml for Java, such as JDOM and Dom4J.
If the client needs a web service, you can consider a Java Web service framework such as Apache CXF, but it is generally unnecessary.