Is there a views plugin that I can use to generate a xml file? I would like something that I could choose the fields I would like to be in the xml and how they would appear (as a tag or a attribute of the parent tag).

For example: I have a content type Picture that has three fields: title, size and dimensions. I would like to create a view that could generate something like this:

  <picture size="1000" dimensions="10x10">
  <picture size="1000" dimensions="10x10">

If there isn't nothing already implemented, what should I implement? I thought about implementing a display plugin, a style, a row plugin and a field handler. Am I wrong?

I wouldn't like do it with the templates because I can't think in a way to make it reusable with templates.

+1  A: 

You might want to look at implementing another theme for XML or using the Services Module.

Also see:

I'm trying Services right now. We'll see how it goes.

There is a somewhat old description of this process on the Drupal forums. It references Drupal 4.7 and 5.x. I suspect the steps for 5.x would be same technique if not same code for Drupal 6.

+3  A: 

A custom style plugin is definitely capable of doing this; I whipped one up to output Atom feeds instead of RSS. You might find a bit of luck starting with the Views Bonus Pack or Views Datasource. Both attempt to provide XML and other output formats for Views data, though the latter was a Google Summer of Code project and hasn't been updated recently. Definitely a potential starting point, though.

Thanks. I think I'll these modules as base to my module.