title: How to remove the Root node from xml while converting to json using xslt
body: <p>{"Root": {
      "u_effective_date": "2017-03-27",
      "u_name": "Test",
      "u_preferred_name": "Test",
      "u_title": "Dir Human Resources",
      "u_department": "Human Resources"
  }}</p>
  
  <p>to</p>
  
  <p>Required output:
  {
      "u_effective_date": "2017-03-27",
      "u_name": "Test",
      "u_preferred_name": "Test",
      "u_title": "Dir Human Resources",
      "u_department": "Human Resources"
  }</p>
  
  <p>Here is the xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Root xmlns:xtt="urn:com.workday/xtt"
  xmlns:etv="urn:com.workday/etv"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ws="urn:com.workday/workersync"&gt;
  &lt;u_effective_date&gt;2017-03-27&lt;/u_effective_date&gt;
  &lt;u_name&gt;Test&lt;/u_name&gt;
  &lt;u_preferred_name&gt;Test&lt;/u_preferred_name&gt;
  &lt;u_title&gt;Dir Human Resources&lt;/u_title&gt;
  &lt;u_department&gt;Human Resources&lt;/u_department&gt;
  &lt;/Root&gt;
  </code></pre>
  
  <p>Below is the xslt i am using:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  </code></pre>
  
  <p>
      </p>
  
  <pre><code>&lt;xsl:template match="/"&gt;{
      &lt;xsl:apply-templates select="*"/&gt;}
  &lt;/xsl:template&gt;
  
  &lt;!-- Object or Element Property--&gt;
  &lt;xsl:template match="*"&gt;
      "&lt;xsl:value-of select="name()"/&gt;" : &lt;xsl:call-template name="Properties"/&gt;
  &lt;/xsl:template&gt;
  
  &lt;!-- Array Element --&gt;
  &lt;xsl:template match="*" mode="ArrayElement"&gt;
      &lt;xsl:call-template name="Properties"/&gt;
  &lt;/xsl:template&gt;
  
  &lt;!-- Object Properties --&gt;
  &lt;xsl:template name="Properties"&gt;
      &lt;xsl:variable name="childName" select="name(*[1])"/&gt;
      &lt;xsl:choose&gt;
          &lt;xsl:when test="not(*|@*)"&gt;"&lt;xsl:value-of select="."/&gt;"&lt;/xsl:when&gt;
          &lt;xsl:when test="count(*[name()=$childName]) &gt; 1"&gt;{ "&lt;xsl:value-of select="$childName"/&gt;" :[&lt;xsl:apply-templates select="*" mode="ArrayElement"/&gt;] }&lt;/xsl:when&gt;
  
  
  
          &lt;xsl:otherwise&gt;{
  
              &lt;xsl:apply-templates select="@*"/&gt;
              &lt;xsl:apply-templates select="*"/&gt;
              }&lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
      &lt;xsl:if test="following-sibling::*"&gt;,&lt;/xsl:if&gt;
  &lt;/xsl:template&gt;
  
  &lt;!-- Attribute Property --&gt;
  &lt;xsl:template match="@*"&gt;"&lt;xsl:value-of select="name()"/&gt;" : "&lt;xsl:value-of select="."/&gt;",
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>