convert remaining levels to XML format