Custom Refactoring Script
The first step in creating a custom refactoring operation is to create an XQuery Update script or XSLT stylesheet that is needed to process the refactoring operations. The easiest way to create this script file is to use the New document wizard to create a new XQuery or XSLT file and you can use the XQuery method example or XSLT method example to help you with the content.
There are cases when it is necessary to add parameters in the XQuery script or XSLT stylesheet. For instance, if you want to rename an element, you may want to declare an external parameter associated with the name of the element to be renamed. To allow you to specify the value for these parameters, they need to be declared in the refactoring operation descriptor file that is associated with this operation.
The next step in creating a custom refactoring operation is to create an XML Refactoring Operation Descriptor file contains the path to the XQuery Update script or XSLT stylesheet.