PayPal.PayPalAPIInterfaceService.Model.RecurringPaymentsProfileDetailsType.ToXMLString C# (CSharp) Method

ToXMLString() public method

public ToXMLString ( string prefix, string name ) : string
prefix string
name string
return string
        public string ToXMLString(string prefix, string name)
        {
            StringBuilder sb = new StringBuilder();
            if(name != null)
            {
                if(prefix != null)
                {
                    sb.Append("<").Append(prefix).Append(":").Append(name).Append(">");
                }
                else
                {
                    sb.Append("<").Append(PreferredPrefix).Append(":").Append(name).Append(">");
                }
            }
            if(SubscriberName != null)
            {
                sb.Append("<").Append(PreferredPrefix).Append(":SubscriberName>").Append(DeserializationUtils.escapeInvalidXmlCharsRegex(this.SubscriberName));
                sb.Append("</").Append(PreferredPrefix).Append(":SubscriberName>");
            }
            if(SubscriberShippingAddress != null)
            {
                sb.Append(SubscriberShippingAddress.ToXMLString(PreferredPrefix,"SubscriberShippingAddress"));
            }
            if(BillingStartDate != null)
            {
                sb.Append("<").Append(PreferredPrefix).Append(":BillingStartDate>").Append(DeserializationUtils.escapeInvalidXmlCharsRegex(this.BillingStartDate));
                sb.Append("</").Append(PreferredPrefix).Append(":BillingStartDate>");
            }
            if(ProfileReference != null)
            {
                sb.Append("<").Append(PreferredPrefix).Append(":ProfileReference>").Append(DeserializationUtils.escapeInvalidXmlCharsRegex(this.ProfileReference));
                sb.Append("</").Append(PreferredPrefix).Append(":ProfileReference>");
            }
            if (name != null)
            {
                if (prefix != null)
                {
                    sb.Append("</").Append(prefix).Append(":").Append(name).Append(">");
                }
                else
                {
                    sb.Append("</").Append(PreferredPrefix).Append(":").Append(name).Append(">");
                }
            }
            return sb.ToString();
        }
RecurringPaymentsProfileDetailsType