<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="servicesender.send();">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private var arr:XML;
private var arrall:XMLList=new XMLList();
private function resudata(evt:ResultEvent):void
{
arr=new XML(evt.result);
arrall=arr.empdetail;
}
private function faultservice(evt:FaultEvent):void
{
Alert.show(evt.fault.faultString);
}
private function count():void
{
Alert.show(arrall.length());
}
]]>
</mx:Script>
<mx:HTTPService id="servicesender" resultFormat="e4x" url="assets/emp.xml" result="resudata(event);" fault="faultservice(event);"/>
<mx:Button width="252" height="108" click="count();" label="XML File Length" x="467.5" y="281" fontSize="20"/>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="servicesender.send();">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private var arr:XML;
private var arrall:XMLList=new XMLList();
private function resudata(evt:ResultEvent):void
{
arr=new XML(evt.result);
arrall=arr.empdetail;
}
private function faultservice(evt:FaultEvent):void
{
Alert.show(evt.fault.faultString);
}
private function count():void
{
Alert.show(arrall.length());
}
]]>
</mx:Script>
<mx:HTTPService id="servicesender" resultFormat="e4x" url="assets/emp.xml" result="resudata(event);" fault="faultservice(event);"/>
<mx:Button width="252" height="108" click="count();" label="XML File Length" x="467.5" y="281" fontSize="20"/>
</mx:Application>
XML File
<?xml version="1.0" encoding="utf-8"?>
<employee>
<empdetail>
<companyname>ABC</companyname>
<companysubname>Technology1</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample</description>
</empdetail>
<empdetail>
<companyname>DEF</companyname>
<companysubname>Technology2</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample1</description>
</empdetail>
<empdetail>
<companyname>GHI</companyname>
<companysubname>Technology3</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample2</description>
</empdetail>
<empdetail>
<companyname>JKL</companyname>
<companysubname>Technology4</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample3</description>
</empdetail>
<empdetail>
<companyname>MNO</companyname>
<companysubname>Technology5</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample4</description>
</empdetail>
<empdetail>
<companyname>Solvedge</companyname>
<companysubname>Enabling Technology</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>jksdkjfhksdjhfkjshfkjhsjkdfhsjkdfhjkshdfjkhsdfjkhsdfhsjkdfhksjh</description>
</empdetail>
</employee>
<employee>
<empdetail>
<companyname>ABC</companyname>
<companysubname>Technology1</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample</description>
</empdetail>
<empdetail>
<companyname>DEF</companyname>
<companysubname>Technology2</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample1</description>
</empdetail>
<empdetail>
<companyname>GHI</companyname>
<companysubname>Technology3</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample2</description>
</empdetail>
<empdetail>
<companyname>JKL</companyname>
<companysubname>Technology4</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample3</description>
</empdetail>
<empdetail>
<companyname>MNO</companyname>
<companysubname>Technology5</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>Sample4</description>
</empdetail>
<empdetail>
<companyname>Solvedge</companyname>
<companysubname>Enabling Technology</companysubname>
<name>kaniskar</name>
<id>000001</id>
<bloodgroup>B+</bloodgroup>
<description>jksdkjfhksdjhfkjshfkjhsjkdfhsjkdfhjkshdfjkhsdfjkhsdfhsjkdfhksjh</description>
</empdetail>
</employee>
Your File Keep in this format
Output