Q: How do I suppress the output of namespaces with XML serialization? I have serialized an object using XmlSerializer and am receiving unwanted namespace attributes in my output. How can I prevent it from printing these namespaces in the XML?
// write and close the bar
XmlSerializer serializer = new XmlSerializer(typeof( DecisionBar));

serializer.Serialize(writer, decision);

public class DecisionBar
{
    public DateTime bartime { get; set; }
    public string frequency { get; set; }
    public bool HH7 { get; set; }
    public bool crossover { get; set; }
    public double mfe { get; set; }
    public double mae { get; set; }
    public double entryPointLong { get; set; }
    public double entryPointShort { get; set; }
}

Output:
<DecisionBar xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <bartime>2012-07-23T07:22:00</bartime>
  <frequency>1 MINUTES</frequency>
  <HH7>true</HH7>
  <crossover>false</crossover>
  <mfe>0</mfe>
  <mae>0</mae>
  <entryPointLong>1.2139</entryPointLong>
  <entryPointShort>1.212</entryPointShort>
</DecisionBar>


A: var ns = new XmlSerializerNamespaces();
ns.Add("", "");
serializer.Serialize(writer, decision, ns);

