Along the same lines as returning XML, if you're returning to javascript code, you may want to consider returning your complex type as serialized in JSON.
Here is an extension method which makes this really easy...
<Extension()> Public Function ToJSON(Of T As Class)(ByVal target As T) As String
Dim serializer = New System.Runtime.Serialization.Json.DataContractJsonSerializer(GetType(T))
Using ms As MemoryStream = New MemoryStream()
serializer.WriteObject(ms, target)
ms.Flush()
Dim bytes As Byte() = ms.GetBuffer()
Dim json As String = Encoding.UTF8.GetString(bytes, 0, bytes.Length).Trim(Chr(0))
Return json
End Using
End Function
Then in your data service, you can simply call
Return MyObject.ToJSON