w.writeStartElement("", "hosts", "");
w.writeStartElement("", "host", "");
w.writeStartElement("", "name", "");
w.writeCharacters("foobar.com");
w.writeEndElement(); //name
w.writeStartElement("", "ip", "");
w.writeCharacters("255.255.255.255");
w.writeEndElement(); //ip
w.writeEndElement(); // host
w.writeEndElement(); //hosts