$re = '/<id>(.+?)<\/id>|<name>(.+?)<\/name>|<time>(.+?)<\/time>|<line>(.+?)<\/line>|<timeMin>(.+?)<\/timeMin>/';
$str = '<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPolling xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Polling>
<id>1494</id>
<name>Street xyz</name>
<time>14.08</time>
<line>AB2</line>
<timeMin>5</timeMin>
</Polling>
<Polling>
<id>1494</id>
<name>Street xyz</name>
<time>14.10</time>
<line>140</line>
<timeMin>7</timeMin>
</Polling>
<Polling>
<id>1494</id>
<name>Street xyz</name>
<time>14.12</time>
<line>AB2</line>
<timeMin>9</timeMin>
</Polling>
<Polling>
<id>1494</id>
<name>Street xyz</name>
<time>14.15</time>
<line>140</line>
<timeMin>12</timeMin>
</Polling>
</ArrayOfPolling>';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php