#!/usr/bin/perl use XML::XSH2; xsh << '__XSH__'; open 'C:\location\test.xml' ; for /httpsRoutes/httpsRoute echo @hostname (key) @tier | type > out.txt __XSH__