How would I limit ToXod conversions to no more then 30 seconds?
You can switch to one of the ToXod methods that return a filter. Then you can exit the reading loop whenever you like.
This forum post shows how to convert this way
That being said, you might not want to do this, as files might just be taking a long time. Using the ToXod that returns a filter, would allow you to monitor the conversion. Note, that the first read will block the longest, as some full document pre-processing has to occur here, so either don’t time the first read, or give it an order of magnitude longer time, then the subsequent reads.