xReplace is a procedural text editor. That is, you define a process of manipulation which will be performed for every file which xReplace opens as input and the result of that manipulation will be sent to the output.
Therefore, there are three parts of an xReplace script, input, output and transformations.
One key aspect to understanding how xReplace works is the idea of a pipeline, where each action defined in the transformations happens at a certain point in that pipeline. Generally when a file is read, its content is stored on the main pipeline. Other pipelines can be created by storing content to a ‘label’ and then manipulating content using actions which read from and write to that ‘label’.