Java tutorial
//package com.java2s; public class Main { public static String getCreditPaymentXml(String cardHolder, String cardNum, String cardSec, String cardExp) { StringBuffer buffer = new StringBuffer(); buffer.append("<payment>"); buffer.append("<type>Credit</type>"); buffer.append("<cardHolder>" + cardHolder + "</cardHolder>"); buffer.append("<cardNum>" + cardNum + "</cardNum>"); buffer.append("<cardSec>" + cardSec + "</cardSec>"); buffer.append("<cardExp>" + cardExp + "</cardExp>"); buffer.append("</payment>"); return buffer.toString(); } }