Update model2xml.py

Fix bug while building tree with multiple files