it works exactly the same way as it does on agsXMPP. Instead of Element you have to derive your custom objects from XmppXElement.
You also have to register your types in the factory. And you should use namespaces for your types.
I suggest to use xelement.Element<...> to get nested types instead of xelement.GetTag<...>

Will I find some hints/description in the documentation of the lib's release to get to know what method I have to use and in what circumstances (what is the idea of the method, poperty, ...) ? With the content in the MatriX for Silverlight docu it's very hard for me to figure out what to use.

My first post here. I have a similar problem to martinbach, except that I am trying to return a collection of results from a custom Iq. I can't work out what is the correct format of an Iq that is a collection. To relate it to the Person and Address sample, how could this be changed is a person has a collection of Addresses?

Just to be clear, what I want to do is send an Iq and get a response that is a collection and to then iterate through the collection. Going back to my domain, the request would look like this:

publicclass NearestVehicles : XmppXElement

{

public NearestVehicles()

: base("cgi-recovery:geoqueries", "nearestvehicles")

{

}

publicstring Eastings

{

get {return GetTag("Eastings"); }

set { SetTag("Eastings", value); }

}

publicstring Northings

{

get {return GetTag("Northings"); }

set { SetTag("Northings", value); }

}

}

In the develop's guide, the response is the same type as the request, so we could add some extra properties to the request, which will get used in the response:

publicclass NearestVehicles : XmppXElement

{

public NearestVehicles()

: base("cgi-recovery:geoqueries", "nearestvehicles")

{

}

publicstring Eastings

{

get {return GetTag("Eastings"); }

set { SetTag("Eastings", value); }

}

publicstring Northings

{

get {return GetTag("Northings"); }

set { SetTag("Northings", value); }

}

publicstring VehicleName

{

get {return GetTag("VehicleName"); }

set { SetTag("VehicleName", value); }

}

publicstring OfficeName

{

get {return GetTag("OfficeName"); }

set { SetTag("OfficeName", value); }

}

publicstring Distance

{

get {return GetTag("Distance"); }

set { SetTag("Distance", value); }

}

}

This of course works for a single result, but if my query is to return a collection, what is the best pattern? Can I use the above and somehow (how?) construct more than one response, or if the correct pattern to have some form of collection in the Iq response, such as:

I removed some stuff from your classes to make it easier to understand for other programmers as well.

The Xml with a collection of vehicles will look like this:

<Vehiclesxmlns='cgi-recovery:geoqueries'>

<Vehicle>

<VehicleName>bus001</VehicleName>

<Distance>150</Distance>

</Vehicle>

<Vehicle>

<VehicleName>bus002</VehicleName>

<Distance>100</Distance>

</Vehicle>

<Vehicle>

<VehicleName>bus003</VehicleName>

<Distance>200</Distance>

</Vehicle>

</Vehicles>

lets first create the object for a single vehicle. The Xml of a single vehicle which inherited your namespace looks like this:

<Vehiclexmlns='cgi-recovery:geoqueries'>

<VehicleName>bus003</VehicleName>

<Distance>200</Distance>

</Vehicle>

this is the code of the vehicle class:

publicclass Vehicle : XmppXElement

{

public Vehicle()

: base("cgi-recovery:geoqueries", "Vehicle")

{

}

publicstring VehicleName

{

get {return GetTag("VehicleName"); }

set { SetTag("VehicleName", value); }

}

publicint Distance

{

get {return GetTagInt("Distance"); }

set { SetTag("Distance", value); }

}

}

now we create the object for the vehicles collection (the <Vehicles/> node):
It contains a AddVehicle member to add new vehicles and the GetVehicles member to get all vehicles in the collection. Add more members as you need them.

What I was struggling with was the service consumer side and how to get the response and iterate over the vehicles collection. The important part that I was stuck on being that Vehicles is defined with: