@Test
public void testGetDocument() throws Exception {

    final VoiceXmlDocument vxmlDocument = new VoiceXmlDocument();
    final Vxml vxml = vxmlDocument.getVxml();
    final Form form = vxml.appendChild(Form.class);
    final Grammar grammar = form.appendChild(Grammar.class);
    grammar.setVersion("1.0");
    grammar.setType(GrammarType.SRGS_XML);
    final Rule rule = grammar.appendChild(Rule.class);
    final OneOf oneof = rule.appendChild(OneOf.class);
    final Item item1 = oneof.appendChild(Item.class);
    item1.addText("visa");
    final Item item2 = oneof.appendChild(Item.class);
    item2.addText("mastercard");
    final Item item3 = oneof.appendChild(Item.class);
    item3.addText("american express");
    final InternalGrammarDocument document = new InternalGrammarDocument(
            grammar);
    document.setModeType(ModeType.VOICE);
    document.setMediaType(GrammarType.SRGS_XML);
    Assert.assertEquals(grammar.toString(), document.getDocument());
}