hl7 v2 - Creating HL7 v2.3.1 A28 message in XML with ZD1 Segment, Fields & Components using Java HAPI -


i using java create a28 message in hl7 xml format. output want : xyzcompany . able add non-standard segment zd1 using: string ap = adt.addnonstandardsegment("zd1"); added zd1.1 field using terser. trying add xon.1 component: terser te = new terser(adt); string str =("xyz company");

str = stringescapeutils.escapexml11(str);

te.set("zd1-1-1" , str );

but, doesn't print xyzcompany prints <xon.1>navy</xon.1> . questions: 1) right use terser set zd1.1 field xon.1 component using methid? 2) have use custom zd1 class set , methods output (xyz company) desired? 3) if custom zd1 class needs defined, how associate adt message object encoding works? . please let me know if have example custom z segment creation along fields , components.

thank in advance.