Maybe we can abstract this while-try-except stuff away in a custom context manager. Eg:

```python
with iterate(software_id, separator, end) as software_id:
    print(software_id, end='')
```

The same could be used for the swid tags.