Restructuring XML file

I have a client who would like to have drop down list added to his registration form that lists all of the provinces in the world by their country code. To that end, he gave me this file. Unfortunately, the structure of the data will not work for what I need to do. Below is the structure I'd like to have. Is there some way to automatically restructure the data, perhaps by using XSLT or something similar? Thanks!

  <country code="US">


This is easily accomplished by adding a single template to the XSLT identity transform:

<xsl:stylesheet version="1.0" xmlns:xsl="">

   <xsl:output method="xml" indent="yes"/>

   <xsl:template match="node() | @*">
          <xsl:apply-templates select="node() | @*" />

   <xsl:template match="countries/*">
       <country code="{name()}">
          <xsl:apply-templates select="region"/>


Need Your Help

refresh input after ajax submit form

jquery ajax json

I searched all over but couldn't find how to refresh specific input field via js/jquery/ajax.

Wrap text in syllables TextView located in TableRow

android textview tablerow

Text that does not fit into the width cropped.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.