get Address Xml by appending tag string together - Java XML

Java examples for XML:XML String

Description

get Address Xml by appending tag string together

Demo Code


//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*/
}

Related Tutorials