Is there any way to create an xml file or is there any library for creating an xml file in UiPath Studio? Right now I am just appending the xml content to file with the append activity. But that will not be good solution when the automation solution grows.
You can use XDocument / XElement Class etc in System.Xml.Linq namespace.
If you already have an xml file, you can deserialize to XDocument class using Deserialize XML activity in UiPath.Web.Activities Package (UiPath.WebAPI.Activities Package), vice versa.
So this needs to be done with invoke code activity. Is there any way to create a generic functional block and just call with parameters when required. Just to minimize the line of code and complexity
It’s doesn’t always have to use Invoke code activity. Usually we use Assign activity and Invoke Method activity for it. And it’s good to create a workflow to handle XML and call it using Invoke Workflow file activity.
The following is a sample for handling XML without Invoke Code. (It requires Web.Activity.Package to deserialize)