title: Create SOAP Envelope XML String
body: <p>I have to generate XML string like below for SOAP request. </p>
  
  <pre><code>&lt;soapenv:Body&gt;
  &lt;user:getUserProfile&gt;
       &lt;user:getUserProfileInput&gt;
          &lt;requestorInfoDVO&gt;
             &lt;dvo:ApplicationName&gt;?&lt;/dvo:ApplicationName&gt;
             &lt;!--Optional:--&gt;
             &lt;dvo:HostName&gt;?&lt;/dvo:HostName&gt;
             &lt;!--Optional:--&gt;
             &lt;dvo:CorrelationId&gt;?&lt;/dvo:CorrelationId&gt;
          &lt;/requestorInfoDVO&gt;
          &lt;dvo1:getUserProfileInputDVO&gt;
             &lt;dvo1:effectiveDate&gt;?&lt;/dvo1:effectiveDate&gt;
             &lt;dvo1:commissionLevelServiceInputDVO&gt;
                &lt;dvo1:UserCode&gt;?&lt;/dvo1:UserCode&gt;
                &lt;dvo1:stateCode&gt;?&lt;/dvo1:stateCode&gt;
                &lt;dvo1:marketCode&gt;?&lt;/dvo1:marketCode&gt;
                &lt;dvo1:program&gt;?&lt;/dvo1:program&gt;
                &lt;!--Optional:--&gt;
                &lt;dvo1:lob&gt;?&lt;/dvo1:lob&gt;
                &lt;!--Optional:--&gt;
                &lt;dvo1:reportingOffice&gt;?&lt;/dvo1:reportingOffice&gt;
                &lt;!--Optional:--&gt;
                &lt;dvo1:userTypeCd&gt;?&lt;/dvo1:userTypeCd&gt;
             &lt;/dvo1:commissionLevelServiceInputDVO&gt;
          &lt;/dvo1:getUserProfileInputDVO&gt;
       &lt;/user:getUserProfileInput&gt;
    &lt;/user:getUserProfile&gt;
  &lt;/soapenv:Body&gt;
  </code></pre>
  
  <p>I have used the below code request to get format in XML in string.</p>
  
  <p>Below is my C# Code</p>
  
  <pre><code>var request = new getUserProfile
  {
      getUserProfileInput = new getUserProfileInput
      {
          getUserProfileInputDVO = new GetUserProfileInputDVO
          {
              effectiveDate = DateTime.Now,
              commissionLevelServiceInputDVO = new CommissionLevelServiceInputDVO
              {
                  marketCode = "test",
                  program = "QQ",
                  stateCode = "CT",
                  UserCode = "A User"
              }
          },
          requestorInfoDVO = new RequestInfoDVO
          {
              ApplicationName = "TESTAPP",
              CorrelationId = Guid.NewGuid().ToString(),
              HostName = "LOCALHOST"
          }
      }
  };
  
   XmlSerializer xmlSerializer = new XmlSerializer(request.GetType());
   string test = string.Empty;
   using (StringWriter textWriter = new StringWriter())
       {
           xmlSerializer.Serialize(textWriter, request);
           test = textWriter.ToString();
        }
  </code></pre>
  
  <p>But I am getting the below result.</p>
  
  <pre><code>&lt;getUserProfile&gt;
   &lt;getUserProfileInput&gt;
     &lt;getUserProfileInputDVO&gt;
      &lt;effectiveDate&gt;2018-02-15T18:44:31.9012149+05:30&lt;/effectiveDate&gt;
    &lt;commissionLevelServiceInputDVO&gt;
      &lt;marketCode&gt;test&lt;/marketCode&gt;
      &lt;program&gt;QQ&lt;/program&gt;
      &lt;stateCode&gt;CT&lt;/stateCode&gt;
      &lt;UserCode&gt;A User&lt;/UserCode&gt;
    &lt;/commissionLevelServiceInputDVO&gt;
  &lt;/getUserProfileInputDVO&gt;
  &lt;requestorInfoDVO&gt;
    &lt;ApplicationName&gt;TESTAPP&lt;/ApplicationName&gt;
    &lt;CorrelationId&gt;ca003779-3874-4933-8577-c03bc00670c5&lt;/CorrelationId&gt;
    &lt;HostName&gt;LOCALHOST&lt;/HostName&gt;
  &lt;/requestorInfoDVO&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>but I need the result with user: , dvo:,  dvo:1  alias dynamically.
  So, what can i do in request to get the above type of XML?
  So, is there any way to get the result or any change i can do in my request with XML serialize ?</p>