public static bool TryWriteElementValue(this XmlWriter writer, string localName, string ns, bool?value, bool allowEmpty = false) { var prefix = writer.LookupPrefix(ns); return(writer.TryWriteElementValue(prefix, localName, ns, value, allowEmpty: allowEmpty)); }