You could use XSLT and run it from the command line. (I'd recommend Saxon, but Xalan would be ok.)
Here's an example...
XML Input
<doc>
<edit_screen_a/>
<settings_font_size/>
<edit_screen_b/>
<display_screen/>
<settings_font_name/>
</doc>
XSLT 1.0
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="doc">
<doc>
<xsl:apply-templates>
<xsl:sort select="name()"/>
</xsl:apply-templates>
</doc>
</xsl:template>
</xsl:stylesheet>
XML Output
<doc>
<display_screen/>
<edit_screen_a/>
<edit_screen_b/>
<settings_font_name/>
<settings_font_size/>
</doc>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…