Added 'omitXmlDeclaration' parameter and unit test for it.