Parse XElement - get element

koraycas

New Member
I currently have an XElement. I use this to print it:\[code\]System.Diagnostics.Debug.WriteLine(hostedServices);\[/code\]Result:\[code\]<HostedServices xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HostedService> <Url>url</Url> <ServiceName>testcloudservice2</ServiceName> <HostedServiceProperties> <Description>New cloud service</Description> <Location>West Europe</Location> <Label>dGVzdGNsb3Vkc2VydmljZTI=</Label> <Status>Created</Status> <DateCreated>2013-04-02T09:40:27Z</DateCreated> <DateLastModified>2013-04-02T09:40:26Z</DateLastModified> <ExtendedProperties /> </HostedServiceProperties> </HostedService> <HostedService> <Url>url</Url> <ServiceName>testtesttest123445</ServiceName> <HostedServiceProperties> <Description>New cloud service</Description> <Location>West Europe</Location> <Label>dGVzdHRlc3R0ZXN0MTIzNDQ1</Label> <Status>Created</Status> <DateCreated>2013-04-02T09:30:34Z</DateCreated> <DateLastModified>2013-04-02T09:30:34Z</DateLastModified> <ExtendedProperties /> </HostedServiceProperties> </HostedService></HostedServices>\[/code\]I'd like to get the ServiceName and Description of each \[code\]<HostedService>\[/code\]. How can I get these?
 
Back
Top