Formatting xml file using eXtensible stylesheet language in AS 3.0

Hi Everyone,

I have successfully loaded xml file into flash AS 3.0.

Now i need to format the xml file using the eXtensible stylesheet language (xsl) in flash environment.

Can anyone tell me how to format the xml using xsl.

Below is action script code for loading xml
**
import fl.controls.TextArea;

var xml:XML;

var urlRequest:URLRequest = new URLRequest(“cd_catalog.xml”);

var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);

var textArea:TextArea = new TextArea();
textArea.move(5, 5);
textArea.setSize(stage.stageWidth - 10, stage.stageHeight - 10);
addChild(textArea);

function urlLoader_complete(evt:Event):void {
xml = new XML(evt.currentTarget.data);
textArea.text = xml.toXMLString();
}**

And here is my xml file

**<?xml version=“1.0” encoding=“utf-8”?>
<?xml-stylesheet type=“text/xsl” href=“product.xsl”?>
<productdata>
<product>
<name>apple</name>
<description>it’s tasty… :-)</description>
<price>Rs. 10</price>
</product>
<product>
<name>mango</name>
<description>it’s yellow…</description>
<price>Rs. 20</price>
</product>
</productdata>
**

And here is my xls file

**<?xml version=“1.0” encoding=“ISO-8859-1”?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”>

<xsl:template match="/">
<html>
<body>
<h2>My Product Data</h2>
<table border=“1”>
<tr bgcolor="#9acd90">
<th>Product Title</th>
<th>Description</th>
<th>Price</th>
</tr>
<xsl:for-each select=“productdata/product”>
<tr>
<td><xsl:value-of select=“name”/></td>
<td><xsl:value-of select=“description”/></td>
<td><xsl:value-of select=“price”/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>**

Thanks in advance.