Código PHP:
<%@page import="java.io.*, java.util.*, java.sql.*, Conexion.*, java.lang.*"%>
<%@page contentType="text/xml"%>
<%
Connection cn = null;
Conecta con = new Conecta();
cn = con.connect();
String varDato = request.getParameter("txtgenero");
if((varDato==null) || (varDato.length()==0)) {
varDato = "";
}
Statement stm = cn.createStatement();
String consulta = "paMostrarMusica '" + varDato + "' ";
ResultSet rs = stm.executeQuery(consulta);
//out.println("<?xml href='inicio.xml' version='1.0' encoding='UTF-8'?>");
out.println("<?xml version='1.0' encoding='UTF-8'?>");
out.println("<songs>");
while (rs.next()) {
String path = rs.getString(1);
String title = rs.getString(2);
String artis = rs.getString(3);
out.println("<song path='"+artis+"' title='"+path+"' artist='"+title+"'/>");
}
out.println("</songs>");
rs.close();
stm.close();
con.disconnect();
%>