Added docstrings to to_xml() method. Fixes #230