Source Code for:
" XML for B2B
Integration"
VOL 1, Issue 2 p.10

<header/>
<data>
<recordset rowCount="2" fieldNames="url,headline_text,source">
<field name="url">
<string>http://d.moreover.com/click/here.pl?x5835287</string>
<string>http://d.moreover.com/click/here.pl?x5834977</string>
</field>
<field name="headline_text">
<string>Cuban diplomat, expelled from US, must leave Canada</string>
<string>Sharif Lawyers to Boycott Trial</string>
</field>
<field name="source">
<string>CNN</string>
<string>New York Times</string>
</field>
</recordset>
</data>
</wddxPacket>

public class Book
{
// These are the properties of books
public String title;
public String author;
public String isbn;

// This is how we generate XML from a book object
public void toXML(xmlOutputStream xos) { /* details */ }

// This is how we construct a book object from XML
// Think of this as a factory method
public static Book fromXML(xmlInputStream xis) { /* details */ }
}