# Sorting an XML

**URL:** <https://forum.kirupa.com/t/sorting-an-xml/36456>\
**Category:** Uncategorized\
**Created:** [November 26, 2003, 10:00pm UTC](https://forum.kirupa.com/t/sorting-an-xml/36456 "2003-11-26T22:00:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rolando\_lopez](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@rolando\_lopez](https://forum.kirupa.com/u/rolando_lopez)\
**Post date:** [November 26, 2003, 10:00pm UTC](https://forum.kirupa.com/t/sorting-an-xml/36456/1 "2003-11-26T22:00:18Z")

</div>

Hi,  
Given an XML file similar to this:

```auto

<class>
  <student>
    <last_name>Smith</last_name>
  </student>
  <student>
    <last_name>Jackson</last_name>
  </student>
  <student>
    <last_name>Aaron</last_name>
  </student>
</class>

```

Is there a way or a function to sort this XML via last name?

Thanks.
