Question: I am creating an XML file which is based upon the Atom 1.0 specification. The .net Syndication classes are ideal for producing the Atom elements of my document but I need to extend this class so that I can create my own elements like below using strongly types C# classes. What is the best way to extend these classes so to get my desired results?

```
<myNS: userdata myNS:field=”first_name” >Fred Bloggs</myNS:userdata>

```

I have tried to create my own Feed and Item by inheriting from SyndicationFeed and SyndicationItem respectively but this means I will have to create my own feedFormatter class as the Atom10FeedFormatter class only takes SyndicationItems as parameters. I think I am going to have to create the following classes to get my desired result but wanted to put it to the community to see if its the correct way to go an if anybody else has done anything similar.

MyFeedFormatter : Atom10FeedFormatter

MyFeed : SyndicationFeed

MyItem : SyndicationItem

Answer: 
The .NET Syndication Feed supports extensions. It's possible through `SyndicationFeed.ElementExtensions` and `SyndicationFeed.AttributeExtensions`.

<http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.elementextensions.aspx>
I started off doing it this way but I need a way and even created some Extension Methods but I need to make the whole document creation process type safe. 

Therefore I have created elements as objects (see below) which have public properties as there attributes. By just using the extensions I am leaving it open to errors if fields are incorrectly spelt etc and thus not having a valid XML doc.

```
        myItem.userdata = new UserDataElement
                            {
                                Field = “first_name”,
                                Content = "Fred Bloggs"
                            };

```