Con este código, para la transformación solo necesitamos llamarla mandándole un string con el contenido, otro string con el contenido del xsl y “Me.GetType().Assembly.Evidence” y regresará un string con el contenido de la transformación.
Public Function ApplyXMLTransform(ByVal xslSDoc As String, ByVal xmlSDoc As String, ByVal evidence As System.Security.Policy.Evidence) As string Dim xmlDoc As XmlTextReader = New XmlTextReader(New StringReader(xmlSDoc)) Dim xslDoc As XmlTextReader = New XmlTextReader(New StringReader(xslSDoc)) Dim res As New Xml.XmlDocument Dim xslt As New Xml.Xsl.XslTransform xslt.Load(xslDoc, Nothing, evidence) res.Load(xslt.Transform(New Xml.XPath.XPathDocument(xmlDoc), Nothing, New Xml.XmlUrlResolver)) Return res.OuterText End Function