Place the xml string within single quotes and use an awk variable.
This should work:
Code:
#!/bin/sh
XMLSTRING='<thema xmlns=\"x-schema:df.ase\" uid=\"asd_F\" displayname=\"Jdddf 1\" asd_jg_id=\"6\" asd_jg_id_an=\"F\"/>'
awk -v var="$XMLSTRING" '
{if ( $0 ~ /4/ ) {
printf( "%s\n%s\n", $0, var )
}
else {
print $0
}
}' testfile
Regards