<p>Using C# .NET 2.0, I have a composite data class that does have the <code>[Serializable]</code> attribute on it.  I am creating an <code>XMLSerializer</code> class and passing that into the constructor:</p>

<pre><code>XmlSerializer serializer = new XmlSerializer(typeof(DataClass));
</code></pre>

<p>I am getting an exception saying: </p>

<blockquote>
  <p>There was an error reflecting type.</p>
</blockquote>

<p>Inside the data class there is another composite object.  Does this also need to have the <code>[Serializable]</code> attribute, or by having it on the top object, does it recursively apply it to all objects inside?</p>

Look at the inner exception that you are getting.  It will tell you which field/property it is having trouble serializing.
You can exclude fields/properties from xml serialization by decorating them with the
```
[XmlIgnore]
```
attribute.
```
XmlSerializer
```
does not use the
```
[Serializable]
```
attribute, so I doubt that is the problem.