@Test
public void testToXml() {

    // Grab the XML
    String sdXml = sd.toXmlFormatted();
    System.out.println(sdXml);
    // Put it in a file:
    try {
        String sdfname = "serviceDescription.xml";
        BufferedWriter out = new BufferedWriter(new FileWriter(sdfname));
        out.write(sdXml);
        out.close();
        System.out.println("Wrote service description to file: " + sdfname);
    } catch (IOException e) {
        // This is not a critical part of the test, and failure can be
        // ignored.
    }
    // Re-parse and check:
    ServiceDescription nsd = ServiceDescription.of(sdXml);
    assertTrue(
            "Re-serialised ServiceDescription does not match the original. ",
            sd.equals(nsd));
}