@Test
    @SuppressWarnings("deprecation")
    public void testToXml() {
        setUpSertestDocType();
        Document doc = getSertestDocument();
        doc.setFieldValue("mailid", "emailfromalicetobob&someone");
        // Pizza Hut Sunnyvale: x="-122057174" y="37374821" latlong="N37.374821;W122.057174"
        doc.setFieldValue("myposfield", PositionDataType.valueOf(-122057174, 37374821));
        String xml = doc.toXML(" ");
        System.out.println(xml);
        assertTrue(xml.contains(SERTEST_DOC_AS_XML_HEAD));
        assertTrue(xml.contains(SERTEST_DOC_AS_XML_FOOT));
        assertTrue(xml.contains(SERTEST_DOC_AS_XML_WEIGHT1) || xml.contains(SERTEST_DOC_AS_XML_WEIGHT2));
        assertTrue(xml.contains(SERTEST_DOC_AS_XML_SUNNYVALE));
    }
Test for Document and all its features, including (de)serialization.

@author Thomas Gundersen
@author bratseth
document/src/test/java/com/yahoo/document/DocumentTestCase.java