Hopefully this should be an easy answer for someone out there (and possibly a dupe), but I can\'t seem to figure it out.
I need to output an element that looks like
I find the answer here: Xmlserializer - Control Element-Attribute Pairing (revised).
Here is how to do it: mark the value property with the [XmlText] attribute.
public class Quantity {
// your attributes
[XmlAttribute]
public string foo;
[XmlAttribute]
public string bar;
// and the element value (without a child element)
[XmlText]
public int qty;
}