rendered paste bodypublic class Test {
public static void main(String[] args) {
XmlBuffer buf = new XmlBuffer();
try {
buf
.openTag("ItemDiscountAddRq")
.openTag("ItemDiscountAdd").addAttribute("foo", "b&ar").addAttribute("biz", "bam")
.textTag("Name", "Foobar")
.closeTag()
.openTag("ItemDiscountDel")
.textTag("Foo", "barfoo")
.closeTag()
.closeTag();
Output:
<?xml version="1.0"?>
<ItemDiscountAddRq>
<ItemDiscountAdd foo="b&ar" biz="bam">
<Name>Foobar</Name>
</ItemDiscountAdd>
<ItemDiscountDel>
<Foo>barfoo</Foo>
</ItemDiscountDel>
</ItemDiscountAddRq>