---
title: "Generate an object model from an XML string"
url: "https://osherove.com/blog/2008/3/4/generate-an-object-model-from-an-xml-string.md"
canonical: "https://osherove.com/blog/2008/3/4/generate-an-object-model-from-an-xml-string.html"
published: "2008-03-04T08:05:50"
updated: "2008-03-04T08:05:50"
tags: ["Cool Tools", "General Software Devel..."]
author: "Roy Osherove"
description: "Tommy sent me an email: \"I've written a little web application that could come in handy for your many projects. It generates the C# code needed to read and write the given xml (Just past some xml in the textbox). You…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Generate an object model from an XML string

By Roy Osherove March 4, 2008 In [Cool Tools](https://osherove.com/blog/category/cool-tools), [General Software Devel...](https://osherove.com/blog/category/general-software-devel)

**Historical article** · Originally published March 4, 2008; technical details may be outdated.

Tommy sent me an email:

> "I've written a little web application that could come in handy for your many projects. It generates the C# code needed to read and write the given xml (Just past some xml in the textbox). You can find it @ [http://xgeneration.tuyware.com/](http://xgeneration.tuyware.com/ "http://xgeneration.tuyware.com/")
> It's candidate for a lot of improvements, but it's already usefull.
> Enjoy it !"

I tried it out with an RSS feed and it generated classes for all the elements in the feed, with the root element being the one you'd start from, calling root.ReadXML().

Very nice! I can see how this could be useful in many scenarios, but be sure not to paste in anything secure, since this is a web application!

## More in Cool Tools

[All posts in Cool Tools](https://osherove.com/blog/category/cool-tools)

- Jul 5, 2008

    ### [Extending Depender with your own custom dependency rules](https://osherove.com/blog/2008/7/5/extending-depender-with-your-own-custom-dependency-rules.html)

- Jul 5, 2008

    ### [Introducing Depender - Testability Problem Finder](https://osherove.com/blog/2008/7/5/introducing-depender-testability-problem-finder.html)

- Feb 26, 2008

    ### [Fluent XML Library - Ultra cool, short and weet](https://osherove.com/blog/2008/2/26/fluent-xml-library-ultra-cool-short-and-weet.html)

- Feb 21, 2008

    ### [Ad hoc Unit Tests with Snippet Compiler](https://osherove.com/blog/2008/2/21/ad-hoc-unit-tests-with-snippet-compiler.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
