Java examples for XML:XML String
get Address Xml by appending tag string together
//package com.java2s; public class Main { public static String getAddressXml(String street, String city, String state, String zip, String phone) { StringBuffer buffer = new StringBuffer(); buffer.append("<address>"); buffer.append("<street>" + street + "</street>"); buffer.append("<city>" + city + "</city>"); buffer.append("<state>" + state + "</state>"); buffer.append("<zip>" + zip + "</zip>"); buffer.append("<phone>" + phone + "</phone>"); buffer.append("</address>"); return buffer.toString(); }/*from w w w . j a v a 2 s . c o m*/ }