Im currently using XmlNode and Document classes in apex to generate XML from sObject records. It works great for low volumes (up to 1000 records). However after that, I get CPU timeout. I can't see a way to process this data natively without hitting these limits. I have tried moving to Future and also standard best practise such as removing unnecessary fields from queries etc.. but no joy. Can anyone confirm if these classes scale well with CPU limits in mind? If not, do you know a better way to generate the XML? Perhaps off platform or using another class. Thanks
**Update - I was able to get batch apex working natively using string serialization, example here: How to build large single XML Document over multiple batches