private static void SerializeTagsQuery(XmlWriter xmlWriter, TagQuery tagQuery) { xmlWriter.WriteStartElement("TagQuery", ""); if (tagQuery.IsSetMaxKeys()) { xmlWriter.WriteElementString("MaxKeys", "", S3Transforms.ToXmlStringValue(tagQuery.MaxKeys.Value)); } xmlWriter.WriteElementString("IncludeTags", "", tagQuery.IncludeTags ? "true" : "false"); if (tagQuery.IsSetContinuationToken()) { xmlWriter.WriteElementString("ContinuationToken", "", tagQuery.ContinuationToken); } xmlWriter.WriteStartElement("And", ""); foreach (TagQueryFilter filter in tagQuery.And) { SerializeTagQueryFilter(xmlWriter, filter); } xmlWriter.WriteEndElement(); // And xmlWriter.WriteEndElement(); // TagQuery }