diff --git a/xmltodict.py b/xmltodict.py
index 4fdbb16..b0ba601 100755
--- a/xmltodict.py
+++ b/xmltodict.py
@@ -318,7 +318,8 @@ def unparse(input_dict, output=None, encoding='utf-8', full_document=True,
     can be customized with the `newl` and `indent` parameters.
 
     """
-    ((key, value),) = input_dict.items()
+    if full_document and len(input_dict) != 1:
+        raise ValueError('Document must have exactly one root.')
     must_return = False
     if output is None:
         output = StringIO()
@@ -326,7 +327,8 @@ def unparse(input_dict, output=None, encoding='utf-8', full_document=True,
     content_handler = XMLGenerator(output, encoding)
     if full_document:
         content_handler.startDocument()
-    _emit(key, value, content_handler, **kwargs)
+    for key, value in input_dict.items():
+        _emit(key, value, content_handler, **kwargs)
     if full_document:
         content_handler.endDocument()
     if must_return:

Parameter to Disable Multiple Root Check
I'm trying to convert a dict to an xml snippet, but this xml snippet is just supposed to be part of a later full document, so it may or may not have one root element. Unfortunately a ValueError is thrown if there is more than one possible root element - it would be great if there was a keyword parameter to disable that check. (Or perhaps when `full_document=False`)

So for example:
```python
xmltodict.unparse({'node': [1,2,3]}, full_document=False)

# would produce something like this without throwing an error:
"""<node>1</node>
<node>2</node>
<node>3</node>
"""
```
diff --git a/tests/test_dicttoxml.py b/tests/test_dicttoxml.py
index e449316..4b1d4b8 100644
--- a/tests/test_dicttoxml.py
+++ b/tests/test_dicttoxml.py
@@ -49,10 +49,21 @@ class DictToXMLTestCase(unittest.TestCase):
         self.assertEqual(obj, parse(unparse(obj)))
         self.assertEqual(unparse(obj), unparse(parse(unparse(obj))))
 
+    def test_no_root(self):
+        self.assertRaises(ValueError, unparse, {})
+
     def test_multiple_roots(self):
         self.assertRaises(ValueError, unparse, {'a': '1', 'b': '2'})
         self.assertRaises(ValueError, unparse, {'a': ['1', '2', '3']})
 
+    def test_no_root_nofulldoc(self):
+        self.assertEqual(unparse({}, full_document=False), '')
+
+    def test_multiple_roots_nofulldoc(self):
+        obj = OrderedDict((('a', 1), ('b', 2)))
+        xml = unparse(obj, full_document=False)
+        self.assertEqual(xml, '<a>1</a><b>2</b>')
+
     def test_nested(self):
         obj = {'a': {'b': '1', 'c': '2'}}
         self.assertEqual(obj, parse(unparse(obj)))

pip install -e .[dev]
parse_log_pytest
pytest
nose coverage pytest
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
nose==1.3.7
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
-e git+https://github.com/martinblech/xmltodict.git@a3a95592b875cc3d2472a431a197c9c1a5d8a788#egg=xmltodict

name: xmltodict
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - nose==1.3.7
prefix: /opt/conda/envs/xmltodict

tests/test_dicttoxml.py::DictToXMLTestCase::test_multiple_roots_nofulldoc tests/test_dicttoxml.py::DictToXMLTestCase::test_no_root_nofulldoc
tests/test_dicttoxml.py::DictToXMLTestCase::test_attr_order_roundtrip tests/test_dicttoxml.py::DictToXMLTestCase::test_attrib tests/test_dicttoxml.py::DictToXMLTestCase::test_attrib_and_cdata tests/test_dicttoxml.py::DictToXMLTestCase::test_cdata tests/test_dicttoxml.py::DictToXMLTestCase::test_encoding tests/test_dicttoxml.py::DictToXMLTestCase::test_fulldoc tests/test_dicttoxml.py::DictToXMLTestCase::test_list tests/test_dicttoxml.py::DictToXMLTestCase::test_multiple_roots tests/test_dicttoxml.py::DictToXMLTestCase::test_nested tests/test_dicttoxml.py::DictToXMLTestCase::test_no_root tests/test_dicttoxml.py::DictToXMLTestCase::test_preprocessor tests/test_dicttoxml.py::DictToXMLTestCase::test_preprocessor_skipkey tests/test_dicttoxml.py::DictToXMLTestCase::test_pretty_print tests/test_dicttoxml.py::DictToXMLTestCase::test_root tests/test_dicttoxml.py::DictToXMLTestCase::test_semistructured tests/test_dicttoxml.py::DictToXMLTestCase::test_simple_cdata
xmltodict.py
xmltodict.py